From cfe12f716b0e138b51e3d8f5e481c4d9624459dc Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Nov 2014 13:46:21 -0800 Subject: Merge the different implementations of toHex in one central place It's a simple enough function, but we don't need to duplicate those 17 bytes all over the place. Now they'll be duplicated at most once per library. Change-Id: Ic995e2a934b005e7e996e70f2ee644bfa948eb38 Reviewed-by: Jason McDonald --- src/corelib/io/qurlrecode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qurlrecode.cpp') diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp index 9aad2a12bd3..4cf471a248a 100644 --- a/src/corelib/io/qurlrecode.cpp +++ b/src/corelib/io/qurlrecode.cpp @@ -33,6 +33,7 @@ #include "qurl.h" #include "private/qutfcodec_p.h" +#include "private/qtools_p.h" QT_BEGIN_NAMESPACE @@ -197,8 +198,7 @@ static inline ushort decodePercentEncoding(const ushort *input) static inline ushort encodeNibble(ushort c) { - static const uchar hexnumbers[] = "0123456789ABCDEF"; - return hexnumbers[c & 0xf]; + return ushort(QtMiscUtils::toHexUpper(c)); } static void ensureDetached(QString &result, ushort *&output, const ushort *begin, const ushort *input, const ushort *end, -- cgit v1.2.3