diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-10-07 21:53:43 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-10-07 22:18:57 +0200 |
commit | c170fb1e10c770fc90bc5dc3175d0742fb568631 (patch) | |
tree | 5c114c16401834d2075518c35fe9e8c3e7ee2643 /crawl-ref/source/store.cc | |
parent | 9196d74e934400c822341271970fc2a244458429 (diff) | |
download | crawl-ref-c170fb1e10c770fc90bc5dc3175d0742fb568631.tar.gz crawl-ref-c170fb1e10c770fc90bc5dc3175d0742fb568631.zip |
Add prop[const char*] to avoid mallocs of std::strings, add inlines.
The latter muddle the code and suck, but too many platforms rely on GCC < 4.6
so we can't use -flto goodness yet.
Diffstat (limited to 'crawl-ref/source/store.cc')
-rw-r--r-- | crawl-ref/source/store.cc | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/crawl-ref/source/store.cc b/crawl-ref/source/store.cc index 57bea81688..6700edcdc6 100644 --- a/crawl-ref/source/store.cc +++ b/crawl-ref/source/store.cc @@ -876,16 +876,6 @@ dlua_chunk &CrawlStoreValue::get_lua() GET_VAL_PTR(SV_LUA, dlua_chunk*, new dlua_chunk()); } -CrawlStoreValue &CrawlStoreValue::operator [] (const std::string &key) -{ - return get_table()[key]; -} - -CrawlStoreValue &CrawlStoreValue::operator [] (const vec_size &index) -{ - return get_vector()[index]; -} - /////////////////////////// // Const accessor functions #define GET_CONST_SETUP(x) \ @@ -976,18 +966,6 @@ level_pos CrawlStoreValue::get_level_pos() const return *((level_pos*)val.ptr); } -const CrawlStoreValue &CrawlStoreValue::operator - [] (const std::string &key) const -{ - return get_table()[key]; -} - -const CrawlStoreValue &CrawlStoreValue::operator - [](const vec_size &index) const -{ - return get_vector()[index]; -} - ///////////////////// // Typecast operators CrawlStoreValue::operator bool&() { return get_bool(); } @@ -1470,17 +1448,6 @@ const CrawlStoreValue& CrawlHashTable::get_value(const std::string &key) const return (i->second); } -CrawlStoreValue& CrawlHashTable::operator[] (const std::string &key) -{ - return get_value(key); -} - -const CrawlStoreValue& CrawlHashTable::operator[] (const std::string &key) - const -{ - return get_value(key); -} - /////////////////////////// // std::map style interface hash_size CrawlHashTable::size() const @@ -1780,16 +1747,6 @@ const CrawlStoreValue& CrawlVector::get_value(const vec_size &index) const return vec[index]; } -CrawlStoreValue& CrawlVector::operator[] (const vec_size &index) -{ - return get_value(index); -} - -const CrawlStoreValue& CrawlVector::operator[] (const vec_size &index) const -{ - return get_value(index); -} - /////////////////////////// // std::vector style interface vec_size CrawlVector::size() const |