diff options
| author | Mel <mel@rnrd.eu> | 2025-03-15 00:29:25 +0100 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-03-15 00:29:25 +0100 |
| commit | deb42efe7d651a3235531f498be88cbe02661495 (patch) | |
| tree | 0e3da7e410c679208a387e2d91044b513ecdee28 /boot | |
| parent | 6286e528486f2d1dcacc1fd209dda8b4feecf837 (diff) | |
| download | catskill-deb42efe7d651a3235531f498be88cbe02661495.tar.zst catskill-deb42efe7d651a3235531f498be88cbe02661495.zip | |
Access string data directly in iteration macro to avoid bounds-checking
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/common.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
