summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-03-02 14:31:04 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2019-03-02 15:46:27 +0100
commite9c9848d30c90bd430193dd1b408db6889400063 (patch)
tree10b38c3721dd40ef67cecfe9497401c8bc279a99
parent7a810d6a9fb79a24d00e5dbd8e1223e6f8b09677 (diff)
Use implCopySequence to avoid overhead of non-const operator[]
Change-Id: I1e2385c6c7270f7bac9748a61fbf56e3e4246e1c Reviewed-on: https://gerrit.libreoffice.org/68621 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--include/comphelper/sequence.hxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 59cd74fb1b83..7f134294ea57 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -91,10 +91,8 @@ namespace comphelper
OSL_ENSURE(0 <= _nPos && _nPos < nLength, "invalid index");
- for (sal_Int32 i = _nPos + 1; i < nLength; ++i)
- {
- _rSeq[i-1] = _rSeq[i];
- }
+ T* pPos = _rSeq.getArray() + _nPos;
+ internal::implCopySequence(pPos + 1, pPos, nLength - _nPos - 1);
_rSeq.realloc(nLength-1);
}