diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-14 14:57:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-14 21:28:40 +0200 |
commit | 1f9468fc29874eae5100317282ab8b395904406d (patch) | |
tree | 7da605653b3a979d18c2283f42ac8a3efd9eae63 /sc/source/core/data/column3.cxx | |
parent | 43b0d4f709a3a1446a32e36abb5deaa3bb45ddd9 (diff) |
use std::vector::insert instead of push_back
because it will pre-allocate space and often is optimised to memcpy
Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/data/column3.cxx')
-rw-r--r-- | sc/source/core/data/column3.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 79f001c12c91..9bbd9c1bca77 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -852,13 +852,9 @@ public: if (!mbFormula) return; - sc::formula_block::iterator it = sc::formula_block::begin(*node.data); - std::advance(it, nOffset); - sc::formula_block::iterator itEnd = it; - std::advance(itEnd, nDataSize); - - for (; it != itEnd; ++it) - maFormulaCells.push_back(*it); + sc::formula_block::iterator it = sc::formula_block::begin(*node.data) + nOffset; + sc::formula_block::iterator itEnd = it + nDataSize; + maFormulaCells.insert(maFormulaCells.end(), it, itEnd); } break; case sc::element_type_empty: |