Skip to content
Myr

jv_aux.c: replace jv_array_foreach with regular loop in jv_dels()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The code was only conditionally using the value

authored by Emanuele Torre · committed by Emanuele Torre · parent ea78b5a · Browse files · 1 file+2 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−4 removed

  • other:+2 added−4 removed

1 file+2 added−4 removed

modified:src/jv_aux.c+2 added-4 removed
312 unmodified lines
313314 int neg_idx = 0;315 int nonneg_idx = 0;316 int len = jv_array_length(jv_copy(t));317 jv_array_foreach(t, i, elem) {317 for (int i = 0; i < len; ++i) {318 int del = 0;319 while (neg_idx < jv_array_length(jv_copy(neg_keys))) {320 int delidx = len + (int)jv_number_get_value_and_consume(jv_array_get(jv_copy(neg_keys), neg_idx));321 if (i == delidx) {
20 unmodified lines
342 del = 1;343 }344 }345 if (!del)346 new_array = jv_array_append(new_array, elem);347 else348 jv_free(elem);346 new_array = jv_array_append(new_array, jv_array_get(jv_copy(t), i));347 }348 arr_out:349 jv_free(neg_keys);350 jv_free(nonneg_keys);
378 unmodified lines