]> git.kaiwu.me - njs.git/commitdiff
Removed dead store introduced in 398f4de34fe7.
authorDmitry Volyntsev <xeioex@nginx.com>
Sat, 27 May 2023 03:58:19 +0000 (20:58 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Sat, 27 May 2023 03:58:19 +0000 (20:58 -0700)
Found by Coverity (CID 1530432).

src/njs_array.c

index aa9447c3604b5e93fc591c844f96a104b154ad92..f87abd874ea9d730d573d500ae285b7e77cf5668 100644 (file)
@@ -2860,14 +2860,9 @@ njs_sort_indexed_properties(njs_vm_t *vm, njs_value_t *obj, int64_t length,
                         goto exception;
                     }
 
-                    if (slots != NULL) {
-                        p = (void *) njs_cpymem(newslots, slots,
-                                   sizeof(njs_array_sort_slot_t) * (p - slots));
-                        njs_mp_free(vm->mem_pool, slots);
-
-                    } else {
-                        p = newslots;
-                    }
+                    p = (void *) njs_cpymem(newslots, slots,
+                               sizeof(njs_array_sort_slot_t) * (p - slots));
+                    njs_mp_free(vm->mem_pool, slots);
 
                     slots = newslots;
                     end = slots + nlen;