mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-01 17:41:17 +00:00
items, pairs and friends now use unCheckedInc (#22729)
`{.push overflowChecks: off.}` works in backends. Though it could be
implemented as a magic function.
By inspecting the generated C code, the overflow check is eliminated in
the debug or release mode.

Likewise, the index checking is probably not needed.
(cherry picked from commit d82bc0a29f)
This commit is contained in:
@@ -91,7 +91,9 @@ try:
|
||||
`=copy`(lan_ip, splitted[1])
|
||||
echo [lan_ip]
|
||||
echo [splitted[1]]
|
||||
{.push, overflowChecks: false.}
|
||||
inc(i, 1)
|
||||
{.pop.}
|
||||
finally:
|
||||
`=destroy`(splitted)
|
||||
finally:
|
||||
@@ -113,7 +115,9 @@ block :tmp:
|
||||
addInterfaceDecl(c):
|
||||
:tmpD = `=dup`(sym)
|
||||
:tmpD
|
||||
{.push, overflowChecks: false.}
|
||||
inc(i, 1)
|
||||
{.pop.}
|
||||
`=destroy`(shadowScope)
|
||||
-- end of expandArc ------------------------
|
||||
--expandArc: check
|
||||
|
||||
Reference in New Issue
Block a user