summaryrefslogtreecommitdiffstatshomepage
path: root/py/map.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-07 00:54:04 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-07 00:54:04 +0100
commitc75427baaa9f455497c46f754d6f4e8c594fb897 (patch)
tree5b3d8c4cea790ba716983172b45f5a2681b39326 /py/map.c
parent07e24a629477246fb8f363071880e4a2c9cabeb7 (diff)
downloadmicropython-c75427baaa9f455497c46f754d6f4e8c594fb897.tar.gz
micropython-c75427baaa9f455497c46f754d6f4e8c594fb897.zip
py: Revert change to allocation policy for mp_set_t.
Seems that this fixes all set tests.
Diffstat (limited to 'py/map.c')
-rw-r--r--py/map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/map.c b/py/map.c
index dadaa22a92..edd9227d5a 100644
--- a/py/map.c
+++ b/py/map.c
@@ -197,7 +197,7 @@ mp_map_elem_t* mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t
/* set */
void mp_set_init(mp_set_t *set, int n) {
- set->alloc = n;
+ set->alloc = get_doubling_prime_greater_or_equal_to(n + 1);
set->used = 0;
set->table = m_new0(mp_obj_t, set->alloc);
}