docs minor (#15550)

This commit is contained in:
flywind 2020-10-12 02:43:44 +08:00 • committed by GitHub
commit c2c7f60259
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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))