mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-16 14:01:22 +00:00
compiler_ropes: remove unnecessary length check
frmt[frmt.len] isn't an out-of-bounds access for strings (!)
This commit is contained in:
@@ -275,7 +275,7 @@ proc `%`*(frmt: TFormatStr, args: openArray[Rope]): Rope =
|
||||
while true:
|
||||
j = j * 10 + ord(frmt[i]) - ord('0')
|
||||
inc(i)
|
||||
if (i >= length) or frmt[i] notin {'0'..'9'}: break
|
||||
if frmt[i] notin {'0'..'9'}: break
|
||||
num = j
|
||||
if j > high(args) + 1:
|
||||
errorHandler(rInvalidFormatStr, $(j))
|
||||
|
||||
Reference in New Issue
Block a user