From: Mikko Rasa Date: Thu, 4 Mar 2021 10:29:09 +0000 (+0200) Subject: Use the new utilities to format some strings X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=acafbe566fb6f6b5592a2ec3dec667ba7cd3e7e4;ds=sidebyside Use the new utilities to format some strings --- diff --git a/source/core/windows/process.cpp b/source/core/windows/process.cpp index 7b1efd6..d6d1484 100644 --- a/source/core/windows/process.cpp +++ b/source/core/windows/process.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "process.h" #include "process_private.h" @@ -56,10 +57,7 @@ void Process::execute(const string &command, bool path_search, const Arguments & { string cmdline = quote_argument(command); for(Arguments::const_iterator i=args.begin(); i!=args.end(); ++i) - { - cmdline += ' '; - cmdline += quote_argument(*i); - } + append(cmdline, " ", quote_argument(*i)); STARTUPINFO startup; startup.cb = sizeof(STARTUPINFO); diff --git a/source/stringcodec/except.cpp b/source/stringcodec/except.cpp index b4d07ec..23ac3cd 100644 --- a/source/stringcodec/except.cpp +++ b/source/stringcodec/except.cpp @@ -1,4 +1,5 @@ #include +#include #include "except.h" using namespace std; @@ -19,11 +20,7 @@ string invalid_sequence::format_sequence(const string::const_iterator &begin, co { string result; for(string::const_iterator i=begin; i!=end; ++i) - { - if(!result.empty()) - result += ' '; - result += lexical_cast(static_cast(*i), Fmt().fill('0').width(2).hex().uppercase()); - } + append(result, " ", lexical_cast(static_cast(*i), Fmt().fill('0').width(2).hex().uppercase())); return result; }