summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-02-19 18:59:24 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-22 04:38:41 +0100
commitc1d4a634cb439a3c1cc3ce762eb5ace6bb6ead95 (patch)
treebba48f41548c3aee53dcdc3ab5422155b8365c4f /src/corelib
parent3a3a7f88428a13ddd52d80940fbd086e2355bc23 (diff)
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 <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/codecs/qutfcodec.cpp4
1 files changed, 2 insertions, 2 deletions
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;
}