docs minor (#15550)
This commit is contained in:
parent
3eac9b2344
commit
c2c7f60259
1 changed files with 2 additions and 2 deletions
|
|
@ -13,7 +13,7 @@
|
||||||
## None of the procs that get an individual value from the deque can be used
|
## None of the procs that get an individual value from the deque can be used
|
||||||
## on an empty deque.
|
## on an empty deque.
|
||||||
## If compiled with `boundChecks` option, those procs will raise an `IndexDefect`
|
## 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.
|
## 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
|
## 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) =
|
template xBoundsCheck(deq, i) =
|
||||||
# Bounds check for the array like accesses.
|
# 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
|
if unlikely(i >= deq.count): # x < deq.low is taken care by the Natural parameter
|
||||||
raise newException(IndexDefect,
|
raise newException(IndexDefect,
|
||||||
"Out of bounds: " & $i & " > " & $(deq.count - 1))
|
"Out of bounds: " & $i & " > " & $(deq.count - 1))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue