From 3888f5a251d6230cc290ec0ada211a6b45307615 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 29 Jul 2014 16:53:34 -0700 Subject: 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 --- src/corelib/tools/qstringiterator_p.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/corelib/tools/qstringiterator_p.h') 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"); -- cgit v1.2.3