mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
docs minor (#15550)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
## None of the procs that get an individual value from the deque can be used
|
||||
## on an empty deque.
|
||||
## If compiled with `boundChecks` option, those procs will raise an `IndexDefect`
|
||||
## on such access. This should not be relied upon, as `-d:release` will
|
||||
## on such access. This should not be relied upon, as `-d:danger` or `--checks:off` will
|
||||
## disable those checks and may return garbage or crash the program.
|
||||
##
|
||||
## As such, a check to see if the deque is empty is needed before any
|
||||
@@ -114,7 +114,7 @@ template emptyCheck(deq) =
|
||||
|
||||
template xBoundsCheck(deq, i) =
|
||||
# Bounds check for the array like accesses.
|
||||
when compileOption("boundChecks"): # d:release should disable this.
|
||||
when compileOption("boundChecks"): # `-d:danger` or `--checks:off` should disable this.
|
||||
if unlikely(i >= deq.count): # x < deq.low is taken care by the Natural parameter
|
||||
raise newException(IndexDefect,
|
||||
"Out of bounds: " & $i & " > " & $(deq.count - 1))
|
||||
|
||||
Reference in New Issue
Block a user