summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-util.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/dbg-util.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/dbg-util.cc')
-rw-r--r--crawl-ref/source/dbg-util.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/dbg-util.cc b/crawl-ref/source/dbg-util.cc
index fac55f12a1..0d33e04d65 100644
--- a/crawl-ref/source/dbg-util.cc
+++ b/crawl-ref/source/dbg-util.cc
@@ -28,7 +28,7 @@ monster_type debug_prompt_for_monster(void)
{
char specs[1024];
- mpr("Which monster by name? ", MSGCH_PROMPT);
+ mprf(MSGCH_PROMPT, "Which monster by name? ");
if (!cancellable_get_line_autohist(specs, sizeof specs))
{
if (specs[0] == '\0')
@@ -451,11 +451,11 @@ void wizard_toggle_dprf()
Options.quiet_debug_messages[i] ? "</white>" : "");
if (i % 5 == 4 || i == NUM_DIAGNOSTICS - 1)
{
- mpr(line, MSGCH_PROMPT);
+ mprf(MSGCH_PROMPT, "%s", line.c_str());
line.clear();
}
}
- mpr("Toggle which debug class (ESC to exit)? ", MSGCH_PROMPT);
+ mprf(MSGCH_PROMPT, "Toggle which debug class (ESC to exit)? ");
int keyin = toalower(get_ch());