summaryrefslogtreecommitdiff
path: root/src/core/smallvec_type.hpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-17 16:53:32 +0000
committerrubidium <rubidium@openttd.org>2009-01-17 16:53:32 +0000
commit3a13b75e37b5642de3c1e89cf6ab3bf860b76375 (patch)
tree76215ba6e27bc0b1f49919c01ff2608f276b8e3d /src/core/smallvec_type.hpp
parent2850bf9e006ebdd40b5562cca5117bca027cfab5 (diff)
downloadopenttd-3a13b75e37b5642de3c1e89cf6ab3bf860b76375.tar.xz
(svn r15126) -Feature: downloading content from a central server (content.openttd.org) where authors can upload they NewGRFS/AI etc. This should make joining servers that use only NewGRFs that are distributed via this system easier as the players can download the NewGRFs from in the game. It should also make it easier to see whether there are updates for NewGRFs and make the necessary updates.
Diffstat (limited to 'src/core/smallvec_type.hpp')
-rw-r--r--src/core/smallvec_type.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp
index a7a0fbad4..f0ca48818 100644
--- a/src/core/smallvec_type.hpp
+++ b/src/core/smallvec_type.hpp
@@ -119,6 +119,17 @@ public:
return this->Find(item) != this->End();
}
+ /** Removes given item from this map
+ * @param item item to remove
+ * @return true iff key was found
+ * @note it has to be pointer to item in this map. It is overwritten by the last item.
+ */
+ FORCEINLINE void Erase(T *item)
+ {
+ assert(item >= this->Begin() && item < this->End());
+ *item = this->data[--this->items];
+ }
+
/**
* Tests whether a item is present in the vector, and appends it to the end if not.
* The '!=' operator of T is used for comparison.