]> Kevux Git Server - fll/commitdiff
Cleanup: Relocate depth increment to inline of the if condition.
authorKevin Day <Kevin@kevux.org>
Mon, 19 Aug 2024 03:35:29 +0000 (22:35 -0500)
committerKevin Day <Kevin@kevux.org>
Mon, 19 Aug 2024 03:35:29 +0000 (22:35 -0500)
level_1/fl_fss/c/fss/embedded_list.c

index 97bf40450846071a83932f68c771871ae067a04e..5d6ed999f987f34811eb66784235308ba0c785c2 100644 (file)
@@ -291,9 +291,7 @@ extern "C" {
 
               // When slashes are even, the object is valid and needs to be processed.
               if (is_object) {
-                ++depth;
-
-                if (depth >= cache->objects->size) {
+                if (++depth >= cache->objects->size) {
                   state->status = f_memory_array_resize(depth + 2, sizeof(f_range_t), (void **) &cache->objects->array, &cache->objects->used, &cache->objects->size);
                   if (F_status_is_error(state->status)) break;
                 }
@@ -399,9 +397,7 @@ extern "C" {
         }
 
         if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-          ++depth;
-
-          if (depth >= cache->objects->size) {
+          if (++depth >= cache->objects->size) {
             state->status = f_memory_array_resize(depth + 2, sizeof(f_range_t), (void **) &cache->objects->array, &cache->objects->used, &cache->objects->size);
             if (F_status_is_error(state->status)) break;
           }