]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/except.cpp
Use the new utilities to format some strings
[libs/core.git] / source / stringcodec / except.cpp
index b4d07ece559706025677393ea019a9cce39799c0..23ac3cd64f8f48c6992600c6641b887924f27a73 100644 (file)
@@ -1,4 +1,5 @@
 #include <msp/strings/format.h>
+#include <msp/strings/utils.h>
 #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<string>(static_cast<unsigned char>(*i), Fmt().fill('0').width(2).hex().uppercase());
-       }
+               append(result, " ", lexical_cast<string>(static_cast<unsigned char>(*i), Fmt().fill('0').width(2).hex().uppercase()));
        return result;
 }