summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/AppHdr.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-09-14 13:39:14 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-09-14 15:05:33 +0200
commit6c9450d3706569e5eedf0cdd7e0327fe8d50612a (patch)
tree3f11044841a459e4f3ca02849f537162a9d81134 /crawl-ref/source/AppHdr.h
parenteb61e843526409124decb3f57e853aaacef5cc26 (diff)
downloadcrawl-ref-6c9450d3706569e5eedf0cdd7e0327fe8d50612a.tar.gz
crawl-ref-6c9450d3706569e5eedf0cdd7e0327fe8d50612a.zip
Use std::unordered_map instead of std::map -- O(1) vs O(log n), in one place for now.
Intentionally not changing other uses yet, let's see if it breaks platforms I couldn't check.
Diffstat (limited to 'crawl-ref/source/AppHdr.h')
-rw-r--r--crawl-ref/source/AppHdr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index 3b7524787c..c9cfd26578 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -374,6 +374,18 @@ inline void UNUSED(const volatile T &)
{
}
+#if defined __GNUC__
+ // gcc-4.0 and gcc-4.1 need the tr1 prefix.
+# include <tr1/unordered_map>
+# define unordered_map tr1::unordered_map
+#else
+ // This doesn't work on MSVC <= 8; it is possible to use stdext::hash_map
+ // with the same STL API, but I have no means to test.
+ // #if _MSC_VER < 1600
+# include <unordered_map>
+#endif
+
+
#endif // __cplusplus
// And now headers we want precompiled