diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2013-09-20 16:22:12 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-23 21:20:47 +0200 |
commit | cc778e1d2108806ef5d14b87eddd3ce8999c27ee (patch) | |
tree | 3dc7c17b8f6916ce9aa931b7c07b6e83665db0e0 /src/gui/image/qxpmhandler.cpp | |
parent | 505579ebe4acc7d3719683e257b0397bc6421925 (diff) |
Remove some qBinaryFind usages from QtGui
This is done per the mailing list discussion at
http://www.mail-archive.com/development@qt-project.org/msg01603.html
Change-Id: I9cbb1790f94e7726e127b9ad1bd5a58c433055a8
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/gui/image/qxpmhandler.cpp')
-rw-r--r-- | src/gui/image/qxpmhandler.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 0ff3c6239d..528bd4ebb1 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -49,6 +49,8 @@ #include <qtextstream.h> #include <qvariant.h> +#include <algorithm> + QT_BEGIN_NAMESPACE static quint64 xpmHash(const QString &str) @@ -747,8 +749,8 @@ inline bool operator<(const XPMRGBData &data, const char *name) static inline bool qt_get_named_xpm_rgb(const char *name_no_space, QRgb *rgb) { - const XPMRGBData *r = qBinaryFind(xpmRgbTbl, xpmRgbTbl + xpmRgbTblSize, name_no_space); - if (r != xpmRgbTbl + xpmRgbTblSize) { + const XPMRGBData *r = std::lower_bound(xpmRgbTbl, xpmRgbTbl + xpmRgbTblSize, name_no_space); + if ((r != xpmRgbTbl + xpmRgbTblSize) && !(name_no_space < *r)) { *rgb = r->value; return true; } else { |