From c1d4a634cb439a3c1cc3ce762eb5ace6bb6ead95 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 19 Feb 2014 18:59:24 -0800 Subject: Fix off-by-one error: the next ASCII character is next one The bit scan function returns the index of the last non-ASCII character. The next ASCII is the one after this. This means all the benchmarks were made while reentering the SIMD loop uselessly... Change-Id: If7de485a63428bfa36d413049d9239ddda1986aa Reviewed-by: Lars Knoll --- src/corelib/codecs/qutfcodec.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/codecs') diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index a5d16b0b54..54312601e4 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -85,7 +85,7 @@ static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const // we don't want to load 32 bytes again in this loop if we know there are non-ASCII // characters still coming n = _bit_scan_reverse(n); - nextAscii = src + n; + nextAscii = src + n + 1; return false; } @@ -115,7 +115,7 @@ static inline bool simdDecodeAscii(ushort *&dst, const uchar *&nextAscii, const // we don't want to load 16 bytes again in this loop if we know there are non-ASCII // characters still coming n = _bit_scan_reverse(n); - nextAscii = src + n; + nextAscii = src + n + 1; return false; } -- cgit v1.2.3