From 841bb4e5bd319e30187245e4d677fe88e6d78c50 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 22 Jul 2018 15:33:07 -0400 Subject: [PATCH] string_util: Remove unnecessary std::string instance in TabsToSpaces() We can just use the variant of std::string's replace() function that can replace an occurrence with N copies of the same character, eliminating the need to allocate a std::string containing a buffer of spaces. --- src/common/string_util.cpp | 13 ++++++------- src/common/string_util.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 80f998549..f7ce3d93c 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -236,15 +236,14 @@ void SplitString(const std::string& str, const char delim, std::vector& output);