make Node.links return a tuple, this may you can't do socket.links.append() by mistake.
[blender.git] / source / blender / blenlib / BLI_array.h
index 6d34b0d48d5be95f8f1b24ccdb67b9a218bfa76c..7c8816cb58a923bcb7b51c21ace3d33ffe926a08 100644 (file)
        ((arr = (void *)_##arr##_static), (_##arr##_count += (num)))              \
            :                                                                     \
        /* use existing static array or allocate */                               \
-       ((BLI_array_totalsize(arr) >= _##arr##_count + num) ?                     \
-           (_##arr##_count += num) :                                             \
+       (LIKELY(BLI_array_totalsize(arr) >= _##arr##_count + num) ?               \
+           (_##arr##_count += num) :  /* UNLIKELY --> realloc */                 \
            (                                                                     \
                (void) (_##arr##_tmp = MEM_callocN(                               \
                        sizeof(*arr) * (num < _##arr##_count ?                    \