Optimize inserts in vector and refactor const reference objects (#659)

Signed-off-by: German Semenov <GermanAizek@yandex.ru>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
Herman Semenov
2023-05-31 20:24:08 +03:00
committed by GitHub
parent 8bea9261bc
commit d464a071da
10 changed files with 21 additions and 4 deletions

View File

@@ -46,6 +46,7 @@ Decorator operator|(Decorator a, Decorator b) {
/// @ingroup dom
Elements operator|(Elements elements, Decorator decorator) { // NOLINT
Elements output;
output.reserve(elements.size());
for (auto& it : elements) {
output.push_back(std::move(it) | decorator);
}