summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-07-15 01:55:02 -0400
committerNeil Moore <neil@s-z.org>2014-07-15 02:07:32 -0400
commit20e1f0bd183b9b9b322c4a6d1f95bd8b6597d2d8 (patch)
tree7467f69e71eed27416102f3dc7dda4e5b97b9f24 /crawl-ref/source/itemprop.cc
parent67f3c00bc4d01a503d82731d1f6dfc106589a9f6 (diff)
downloadcrawl-ref-20e1f0bd183b9b9b322c4a6d1f95bd8b6597d2d8.tar.gz
crawl-ref-20e1f0bd183b9b9b322c4a6d1f95bd8b6597d2d8.zip
Fix compilation, de-inline a function.
There's no reason for this function, called only a few times at init, to be inline. More importantly, it used std::remove_if without including <algorithm>.
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 5e80b66b0f..5f8fb359e1 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -7,6 +7,7 @@
#include "itemname.h"
+#include <algorithm>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
@@ -2729,6 +2730,12 @@ const char* weapon_base_name(weapon_type subtype)
return Weapon_prop[Weapon_index[subtype]].name;
}
+void remove_whitespace(string &str)
+{
+ str.erase(remove_if(str.begin(), str.end(),
+ static_cast<int(*)(int)>(isspace)), str.end());
+}
+
/**
* Try to find a weapon, given the weapon's name without whitespace.
*