From 83ceb7e9e64b7ce7dbdad9973ec3bcb2941030d1 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Mon, 22 Dec 2014 14:21:41 +0300 Subject: [PATCH] Remove qBinaryFind usage from Qt Assistant. It was omitted in commit 49998cea897fa4c5d410ce07bd53f0d1ee0fd180 (QtAlgorithms is getting deprecated). Also remove the overload of operator<() which becomes unused with std::lower_bound(). Change-Id: Iaee3c464e3107c8c3c34def9fa762f22dbd8d510 Reviewed-by: Christian Kandeler --- src/assistant/help/qhelpsearchindexwriter_clucene.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/assistant/help/qhelpsearchindexwriter_clucene.cpp b/src/assistant/help/qhelpsearchindexwriter_clucene.cpp index 5574ec9..55c380d 100644 --- a/src/assistant/help/qhelpsearchindexwriter_clucene.cpp +++ b/src/assistant/help/qhelpsearchindexwriter_clucene.cpp @@ -52,6 +52,8 @@ #include #include +#include + #include "private/qfunctions_p.h" QT_BEGIN_NAMESPACE @@ -325,11 +327,6 @@ static const struct QTextHtmlEntity { "zwnj", 0x200c } }; -Q_STATIC_GLOBAL_OPERATOR bool operator<(const QString &entityStr, const QTextHtmlEntity &entity) -{ - return entityStr < QLatin1String(entity.name); -} - Q_STATIC_GLOBAL_OPERATOR bool operator<(const QTextHtmlEntity &entity, const QString &entityStr) { return QLatin1String(entity.name) < entityStr; @@ -339,7 +336,7 @@ static QChar resolveEntity(const QString &entity) { const QTextHtmlEntity *start = &entities[0]; const QTextHtmlEntity *end = &entities[(sizeof(entities) / sizeof(entities[0]))]; - const QTextHtmlEntity *e = qBinaryFind(start, end, entity); + const QTextHtmlEntity *e = std::lower_bound(start, end, entity); if (e == end) return QChar(); return e->code; -- 2.7.4