From 40cfc638e9088ceba322278b400e98f9d9589be2 Mon Sep 17 00:00:00 2001 From: paulfd Date: Fri, 20 Sep 2019 22:50:34 +0200 Subject: [PATCH] Used abseil's concatenation for string views --- sfizz/Parser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sfizz/Parser.cpp b/sfizz/Parser.cpp index 60e3716b..e5b18ab4 100644 --- a/sfizz/Parser.cpp +++ b/sfizz/Parser.cpp @@ -25,6 +25,7 @@ #include "Config.h" #include "StringViewHelpers.h" #include "absl/strings/str_join.h" +#include "absl/strings/str_cat.h" #include #include @@ -128,7 +129,7 @@ void sfz::Parser::readSfzFile(const std::filesystem::path& fileName, std::vector std::string::size_type findPos = tmpView.find(sfz::config::defineCharacter, lastPos); while (findPos < tmpView.npos) { - newString.append(tmpView, lastPos, findPos - lastPos); + absl::StrAppend(&newString, tmpView.substr(lastPos, findPos - lastPos)); const auto defineEnd = tmpView.find_first_of("= \r\t\n\f\v", findPos); const auto candidate = tmpView.substr(findPos, defineEnd - findPos); @@ -150,7 +151,7 @@ void sfz::Parser::readSfzFile(const std::filesystem::path& fileName, std::vector } // Copy the rest of the string - newString += tmpView.substr(lastPos); + absl::StrAppend(&newString, tmpView.substr(lastPos)); lines.push_back(std::move(newString)); } }