From fc4af46bca93f9ecbc5531803bc8d13f78bb21d2 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 22 Feb 2016 16:00:50 +0100 Subject: [PATCH] Utils: Remove operator[] Because the operator is always accessing data which has a branch is can be much slower than iterators. SmallString is optimized for performance so it would be quite misleading to have a non performing access operator. Change-Id: Id882c3c12508afa393ce0766bbb680690a193c95 Reviewed-by: Tobias Hunger --- src/libs/utils/smallstring.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/libs/utils/smallstring.h b/src/libs/utils/smallstring.h index d2e9e4c29d..05eb93c058 100644 --- a/src/libs/utils/smallstring.h +++ b/src/libs/utils/smallstring.h @@ -177,16 +177,6 @@ public: swap(first.m_data, second.m_data); } - char &operator[](size_type index) - { - return at(index); - } - - const char &operator[](size_type index) const - { - return at(index); - } - QByteArray toQByteArray() const noexcept { return QByteArray(data(), int(size())); -- GitLab