Explain why string.len is used

This commit is contained in:
luk3yx 2024-09-14 20:23:12 +12:00
parent 4563382551
commit 136f2b1637

View File

@ -36,6 +36,8 @@ local function naive_str_width(str)
local prev_w = 0
local line_count = 1
local i = 1
-- string.len() is used so that numbers are coerced to strings without any
-- extra checking
local str_length = strlen(str)
while i <= str_length do
local char = byte(str, i)