From c09a15a442355d88d3c47cfe3ce4ac428337a1cd Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 16 Jan 2022 20:54:34 -0600 Subject: [PATCH] Cleanup: Use += operation when possible. --- level_0/f_string/c/private-string.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/level_0/f_string/c/private-string.c b/level_0/f_string/c/private-string.c index ad179e2..5919c4e 100644 --- a/level_0/f_string/c/private-string.c +++ b/level_0/f_string/c/private-string.c @@ -14,7 +14,7 @@ extern "C" { } memcpy(destination->string + destination->used, source, length); - destination->used = destination->used + length; + destination->used += length; return F_none; } @@ -46,7 +46,7 @@ extern "C" { } memcpy(destination->string + destination->used, source + first, size); - destination->used = destination->used + size; + destination->used += size; } while (i + 1 < length && !source[i + 1]) { @@ -65,7 +65,7 @@ extern "C" { } memcpy(destination->string + destination->used, source + first, size); - destination->used = destination->used + size; + destination->used += size; } return F_none; @@ -350,7 +350,7 @@ extern "C" { memcpy(destination->string, source, length); } - destination->used = destination->used + length; + destination->used += length; return F_none; } #endif // !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_) @@ -383,7 +383,7 @@ extern "C" { memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); memcpy(destination->string + offset, source + first, size); - destination->used = destination->used + size; + destination->used += size; offset += size; } @@ -403,7 +403,7 @@ extern "C" { memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); memcpy(destination->string + offset, source + first, size); - destination->used = destination->used + size; + destination->used += size; offset += size; } } -- 1.8.3.1