diff options
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_iterators.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_iterators.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/bmesh/intern/bmesh_iterators.c b/source/blender/bmesh/intern/bmesh_iterators.c index ff6274cff12..bd28022de4b 100644 --- a/source/blender/bmesh/intern/bmesh_iterators.c +++ b/source/blender/bmesh/intern/bmesh_iterators.c @@ -221,21 +221,21 @@ void *BMO_iter_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], { BMOIter iter; BMElem *ele; - int count = BMO_slot_buffer_count(slot_args, slot_name); + const int slot_len = BMO_slot_buffer_len(slot_args, slot_name); BLI_assert(stack_array_size == 0 || (stack_array_size && stack_array)); - if ((ele = BMO_iter_new(&iter, slot_args, slot_name, restrictmask)) && count > 0) { - BMElem **array = count > stack_array_size ? MEM_mallocN(sizeof(ele) * count, __func__) : - stack_array; + if ((ele = BMO_iter_new(&iter, slot_args, slot_name, restrictmask)) && slot_len > 0) { + BMElem **array = slot_len > stack_array_size ? MEM_mallocN(sizeof(ele) * slot_len, __func__) : + stack_array; int i = 0; do { array[i++] = ele; } while ((ele = BMO_iter_step(&iter))); - BLI_assert(i <= count); + BLI_assert(i <= slot_len); - if (i != count) { + if (i != slot_len) { if ((void **)array != stack_array) { array = MEM_reallocN(array, sizeof(ele) * i); } |