From bce97562b8b96a1aa3657163e7b4815f427f3c33 Mon Sep 17 00:00:00 2001 From: AreaZeroArven <122058867+AreaZeroArven@users.noreply.github.com> Date: Sat, 7 Jan 2023 13:03:50 -0500 Subject: [PATCH 1/2] text: Simplify DynamicPlaceholderTextUtil_Reset Signed-off-by:Arven --- src/dynamic_placeholder_text_util.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/dynamic_placeholder_text_util.c b/src/dynamic_placeholder_text_util.c index 1ec0c1e06ba5..59836bfe9244 100644 --- a/src/dynamic_placeholder_text_util.c +++ b/src/dynamic_placeholder_text_util.c @@ -7,17 +7,11 @@ static EWRAM_DATA const u8 *sStringPointers[8] = {}; void DynamicPlaceholderTextUtil_Reset(void) { - const u8 **ptr; - u8 *fillval; - const u8 **ptr2; - - ptr = sStringPointers; - fillval = NULL; - ptr2 = ptr + (ARRAY_COUNT(sStringPointers) - 1); - do + s32 i; + for (i = 0; i < (s32)ARRAY_COUNT(sStringPointers); i++) { - *ptr2-- = fillval; - } while ((int)ptr2 >= (int)ptr); + sStringPointers[i] = NULL; + } } void DynamicPlaceholderTextUtil_SetPlaceholderPtr(u8 idx, const u8 *ptr) From f120e5b5716241178bff528333f822938384ca47 Mon Sep 17 00:00:00 2001 From: AreaZeroArven <122058867+AreaZeroArven@users.noreply.github.com> Date: Sat, 7 Jan 2023 13:15:51 -0500 Subject: [PATCH 2/2] Remove curly braces --- src/dynamic_placeholder_text_util.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/dynamic_placeholder_text_util.c b/src/dynamic_placeholder_text_util.c index 59836bfe9244..25920c601d6d 100644 --- a/src/dynamic_placeholder_text_util.c +++ b/src/dynamic_placeholder_text_util.c @@ -9,9 +9,7 @@ void DynamicPlaceholderTextUtil_Reset(void) { s32 i; for (i = 0; i < (s32)ARRAY_COUNT(sStringPointers); i++) - { sStringPointers[i] = NULL; - } } void DynamicPlaceholderTextUtil_SetPlaceholderPtr(u8 idx, const u8 *ptr)