Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2021-04-29 17:04:17 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-04-29 17:04:50 +0300
commit9bdb2f5e0b2cbdcdb06af5d672cd8c22742346b2 (patch)
treeaa44a22baad7b80ff3b9e5f8572a5ee164771f6e /source/blender/gpencil_modifiers
parent734c8f9a7717cf1b94a53045f19d1af22031db35 (diff)
Cleanup: Use BLI_findindex instead of loop
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
index a9d4d5091ec..cd29a006aae 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
@@ -108,13 +108,7 @@ static void deformStroke(GpencilModifierData *md,
float rand_offset = BLI_hash_int_01(seed);
/* Get stroke index for random offset. */
- int rnd_index = 0;
- LISTBASE_FOREACH (bGPDstroke *, o_gps, &gpf->strokes) {
- if (o_gps == gps) {
- break;
- }
- rnd_index += 1;
- }
+ int rnd_index = BLI_findindex(&gpf->strokes, gps);
for (int j = 0; j < 3; j++) {
const uint primes[3] = {2, 3, 7};
double offset[3] = {0.0f, 0.0f, 0.0f};