summaryrefslogtreecommitdiffstats
path: root/src/sortdict.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sortdict.h')
-rw-r--r--src/sortdict.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sortdict.h b/src/sortdict.h
index b9f6f7c..bc0488d 100644
--- a/src/sortdict.h
+++ b/src/sortdict.h
@@ -168,6 +168,18 @@ class SDict
return item ? m_list->remove(item) : FALSE;
}
+ /*! Take an item out of the dictionary without deleting it */
+ T *take(const char *key)
+ {
+ T *item = m_dict->take(key);
+ if (item)
+ {
+ int i = m_list->find(item);
+ m_list->take(i);
+ }
+ return item;
+ }
+
/*! Sorts the members of the dictionary. First appending a number
* of members and then sorting them is faster (O(NlogN) than using
* inSort() for each member (O(N^2)).