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/stash.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/stash.cc')
-rw-r--r-- | crawl-ref/source/stash.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index f84693a176..e18db60a3c 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -131,7 +131,7 @@ void describe_stash(const coord_def& c) { string desc = get_stash_desc(c); if (!desc.empty()) - mpr(desc.c_str(), MSGCH_EXAMINE_FILTER); + mprf(MSGCH_EXAMINE_FILTER, "%s", desc.c_str()); } @@ -1781,7 +1781,7 @@ void StashTracker::search_stashes() if (!search->valid() && csearch != "*") { - mpr("Your search expression is invalid.", MSGCH_PLAIN); + mprf(MSGCH_PLAIN, "Your search expression is invalid."); lastsearch = help; return ; } @@ -1790,13 +1790,13 @@ void StashTracker::search_stashes() if (results.empty()) { - mpr("Can't find anything matching that.", MSGCH_PLAIN); + mprf(MSGCH_PLAIN, "Can't find anything matching that."); return; } if (results.size() > SEARCH_SPAM_THRESHOLD) { - mpr("Too many matches; use a more specific search.", MSGCH_PLAIN); + mprf(MSGCH_PLAIN, "Too many matches; use a more specific search."); return; } |