summaryrefslogtreecommitdiff
path: root/src/ColorizedStream.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-11-23 15:34:43 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-11-23 15:34:43 +0900
commit03d5b4627b86c09fdbca3227e21efb5251ac0043 (patch)
tree1b11d9b9ad56a7147ed1c6ba32c5a766c394bbbe /src/ColorizedStream.cc
parent80528aa9cee07f05cbd536627ca876ddf56b9407 (diff)
ColorizedStreamBuf::str: Append character prefix to stream directly
Diffstat (limited to 'src/ColorizedStream.cc')
-rw-r--r--src/ColorizedStream.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ColorizedStream.cc b/src/ColorizedStream.cc
index 4388406e..0f7656c3 100644
--- a/src/ColorizedStream.cc
+++ b/src/ColorizedStream.cc
@@ -86,9 +86,7 @@ std::string ColorizedStreamBuf::str(bool color, size_t max) const
}
auto size = e.second.size();
if (size > max) {
- auto cut = e.second;
- cut.resize(max);
- rv << cut;
+ rv.write(e.second.c_str(), max);
break;
}
rv << e.second;