diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-11-28 23:33:32 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-11-29 01:07:35 +0100 |
commit | 5f4ae1ef05d92d9da03cde00b07d187f2f53a06d (patch) | |
tree | 01dbc85606ad5ab882333b1695c915b63e97b96d /crawl-ref/source/view.cc | |
parent | 2965f04181dcb6530b93acb194ba5f7561d8adc9 (diff) | |
download | crawl-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/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index b039186082..751c4df3f1 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -301,12 +301,12 @@ void update_monsters_in_view() } if (size == 1) - mpr(msgs[0], MSGCH_WARN); + mprf(MSGCH_WARN, "%s", msgs[0].c_str()); else { while (types.size() > max_msgs && !genera.empty()) _genus_factoring(types, genera); - mpr(_desc_mons_type_map(types), MSGCH_WARN); + mprf(MSGCH_WARN, "%s", _desc_mons_type_map(types).c_str()); } bool warning = false; @@ -342,7 +342,7 @@ void update_monsters_in_view() warning_msg += "."; } if (warning) - mpr(warning_msg, MSGCH_GOD); + mprf(MSGCH_GOD, "%s", warning_msg.c_str()); } // Xom thinks it's hilarious the way the player picks up an ever |