forked from qt-creator/qt-creator
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 <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -177,16 +177,6 @@ public:
|
|||||||
swap(first.m_data, second.m_data);
|
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
|
QByteArray toQByteArray() const noexcept
|
||||||
{
|
{
|
||||||
return QByteArray(data(), int(size()));
|
return QByteArray(data(), int(size()));
|
||||||
|
|||||||
Reference in New Issue
Block a user