Remove qBinaryFind usage from Qt Assistant.
authorAlexander Volkov <a.volkov@rusbitech.ru>
Mon, 22 Dec 2014 11:21:41 +0000 (14:21 +0300)
committerAlexander Volkov <a.volkov@rusbitech.ru>
Tue, 6 Jan 2015 09:23:44 +0000 (10:23 +0100)
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 <christian.kandeler@theqtcompany.com>
src/assistant/help/qhelpsearchindexwriter_clucene.cpp

index 5574ec9..55c380d 100644 (file)
@@ -52,6 +52,8 @@
 #include <QtNetwork/QLocalSocket>
 #include <QtNetwork/QLocalServer>
 
+#include <algorithm>
+
 #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;