summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/message-stream.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-11-28 23:33:32 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-11-29 01:07:35 +0100
commit5f4ae1ef05d92d9da03cde00b07d187f2f53a06d (patch)
tree01dbc85606ad5ab882333b1695c915b63e97b96d /crawl-ref/source/message-stream.cc
parent2965f04181dcb6530b93acb194ba5f7561d8adc9 (diff)
downloadcrawl-ref-5f4ae1ef05d92d9da03cde00b07d187f2f53a06d.tar.gz
crawl-ref-5f4ae1ef05d92d9da03cde00b07d187f2f53a06d.zip
Replace `mpr(s, ch)` with `mprf(ch, s)`
Also simplify quite a few cases. It turns out in >90% cases of non-literals the argument had .c_str(), which meant it was pointlessly malloc()ed and converted from and to std::string. I believe a sprintf is faster, so even the argument of miniscule speed-up doesn't apply.
Diffstat (limited to 'crawl-ref/source/message-stream.cc')
-rw-r--r--crawl-ref/source/message-stream.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/message-stream.cc b/crawl-ref/source/message-stream.cc
index 4b074359ee..e21e6f780b 100644
--- a/crawl-ref/source/message-stream.cc
+++ b/crawl-ref/source/message-stream.cc
@@ -73,7 +73,7 @@ namespace msg
{
// null-terminate and print the string
internal_buf[internal_count] = 0;
- mpr(internal_buf, channel, param);
+ mprf(channel, param, "%s", internal_buf);
internal_count = 0;
@@ -85,7 +85,7 @@ namespace msg
if (internal_count + 3 > INTERNAL_LENGTH)
{
- mpr("oops, hit overflow", MSGCH_ERROR);
+ mprf(MSGCH_ERROR, "oops, hit overflow");
internal_count = 0;
return streambuf::traits_type::eof();
}