Skip to content

Commit

Permalink
Add missing code formatting (#49983)
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy authored May 29, 2023
1 parent 248ceda commit 0d5bd2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/src/devdocs/boundscheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ end
With a custom array-like type `MyArray` having:

```julia
@inline getindex(A::MyArray, i::Real) = (@boundscheck checkbounds(A,i); A.data[to_index(i)])
@inline getindex(A::MyArray, i::Real) = (@boundscheck checkbounds(A, i); A.data[to_index(i)])
```

Then when `getindex` is inlined into `sum`, the call to `checkbounds(A,i)` will be elided. If
Then when `getindex` is inlined into `sum`, the call to `checkbounds(A, i)` will be elided. If
your function contains multiple layers of inlining, only `@boundscheck` blocks at most one level
of inlining deeper are eliminated. The rule prevents unintended changes in program behavior from
code further up the stack.
Expand All @@ -57,7 +57,7 @@ with [`OffsetArrays`](@ref man-custom-indices):
```julia-repl
julia> using OffsetArrays
julia> sum(OffsetArray([1,2,3], -10))
julia> sum(OffsetArray([1, 2, 3], -10))
9164911648 # inconsistent results or segfault
```

Expand Down Expand Up @@ -123,4 +123,4 @@ the last argument).

## Emit bounds checks

Julia can be launched with `--check-bounds={yes|no|auto}` to emit bounds checks always, never, or respect @inbounds declarations.
Julia can be launched with `--check-bounds={yes|no|auto}` to emit bounds checks always, never, or respect `@inbounds` declarations.

0 comments on commit 0d5bd2f

Please sign in to comment.