diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-02-20 17:17:40 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-02-20 17:28:25 +0300 |
commit | fe9b21a44ad25f068da88f6e12b60c1486be3605 (patch) | |
tree | f2ff785c3a59efa3f756ba0042262b332a0930d9 /source/gameengine | |
parent | 90e77c871b771ad9df23c3e3c9b255d75c409b60 (diff) |
Add GHash/GSet pop() feature.
Behavior is similar to python's set.pop(), it removes and returns a 'random' entry from the hash.
Notes:
* Popping will return items in same order as ghash/gset iterators (i.e. increasing
order in internal buckets-based storage), unless ghash/gset is modified in between.
* We are keeping a track of the latest bucket we popped out (through a 'state' parameter),
this allows for similar performances to iterators when iteratively popping a whole hash
(without it, we are roughly O(n!), with it we are roughly O(n)...).
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D1808
Diffstat (limited to 'source/gameengine')
0 files changed, 0 insertions, 0 deletions