From deb42efe7d651a3235531f498be88cbe02661495 Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 15 Mar 2025 00:29:25 +0100 Subject: Access string data directly in iteration macro to avoid bounds-checking Signed-off-by: Mel --- boot/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'boot/common.c') diff --git a/boot/common.c b/boot/common.c index d43bbc1..e696663 100644 --- a/boot/common.c +++ b/boot/common.c @@ -83,8 +83,8 @@ struct String }; #define STRING_ITERATE(index, c, str) \ - ascii c = string_at(str, 0); \ - for (uint index = 0; index < str.length; c = string_at(str, ++index)) + ascii c = str.data[0]; \ + for (uint index = 0; index < str.length; c = str.data[++index]) // allocates a new string in the global string region. struct String -- cgit 1.4.1