From: Kevin Day Date: Wed, 15 Dec 2021 02:34:21 +0000 (-0600) Subject: Update: Don't bother checking, just always update pointer. X-Git-Tag: 0.5.7~33 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=dcec1cb503d69a1c4ba48a1d70d0f3a772749a5a;p=fll Update: Don't bother checking, just always update pointer. At this point the pointer has been allocated. If the pointer addresses are the same, then there is no problem. If they are different, then this properly replaces. Assigning this just removes the extra step of checking. --- diff --git a/level_0/f_memory/c/private-memory.c b/level_0/f_memory/c/private-memory.c index 8b5761c..ad95869 100644 --- a/level_0/f_memory/c/private-memory.c +++ b/level_0/f_memory/c/private-memory.c @@ -33,9 +33,7 @@ extern "C" { memset(((uint8_t *) new_pointer) + (type_size * length_old), 0, type_size * (length_new - length_old)); } - if (pointer != new_pointer) { - *pointer = new_pointer; - } + *pointer = new_pointer; return F_none; } @@ -83,9 +81,7 @@ extern "C" { memset(((uint8_t *) new_pointer) + (type_size * length_old), 0, type_size * (length_new - length_old)); } - if (pointer != new_pointer) { - *pointer = new_pointer; - } + *pointer = new_pointer; return F_none; }