summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstringiterator_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-07-29 16:53:34 -0700
committerThiago Macieira <thiago.macieira@intel.com>2014-08-19 03:39:39 +0200
commit3888f5a251d6230cc290ec0ada211a6b45307615 (patch)
tree06d1dd9d3126638fff2d42d90383396329e3e0ad /src/corelib/tools/qstringiterator_p.h
parent55c1f54c5550848af9aa2ababb559b8f2346c912 (diff)
Unify and refactor QString::to{Upper,Lower,CaseFolded}
This unifies the code for those three functions in one refactored template function, using QStringIterator. I don't think there's any loss of performance by doing that refactoring -- this is based on my reading of the disassembly, without running any benchmarks. Change-Id: I5893c6ed47462c473886c722a21577b1e8a23841 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools/qstringiterator_p.h')
-rw-r--r--src/corelib/tools/qstringiterator_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringiterator_p.h b/src/corelib/tools/qstringiterator_p.h
index c3986f0477..1e231792a2 100644
--- a/src/corelib/tools/qstringiterator_p.h
+++ b/src/corelib/tools/qstringiterator_p.h
@@ -71,6 +71,11 @@ public:
return pos;
}
+ inline int index() const
+ {
+ return pos - i;
+ }
+
inline void setPosition(QString::const_iterator position)
{
Q_ASSERT_X(i <= position && position <= e, Q_FUNC_INFO, "position out of bounds");