Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't specify namespace for imported names #363

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/blockaxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
last(b::BlockedUnitRange)::Integer = isempty(blocklasts(b)) ? first(b)-1 : last(blocklasts(b))

# view and indexing are identical for a unitrange
Base.view(b::BlockedUnitRange, K::Block{1}) = b[K]
view(b::BlockedUnitRange, K::Block{1}) = b[K]

Check warning on line 262 in src/blockaxis.jl

View check run for this annotation

Codecov / codecov/patch

src/blockaxis.jl#L262

Added line #L262 was not covered by tests

@propagate_inbounds function getindex(b::BlockedUnitRange, K::Block{1})
k = Integer(K)
Expand Down
8 changes: 4 additions & 4 deletions src/blockindices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@
end

# Some views may be computed eagerly without the SubArray wrapper
Base.@propagate_inbounds Base.view(r::AbstractRange, B::Block{1}) = r[to_indices(r, (B,))...]
Base.@propagate_inbounds function Base.view(C::CartesianIndices{N}, b1::Block{1}, B::Block{1}...) where {N}
@propagate_inbounds view(r::AbstractRange, B::Block{1}) = r[to_indices(r, (B,))...]
@propagate_inbounds function view(C::CartesianIndices{N}, b1::Block{1}, B::Block{1}...) where {N}

Check warning on line 118 in src/blockindices.jl

View check run for this annotation

Codecov / codecov/patch

src/blockindices.jl#L117-L118

Added lines #L117 - L118 were not covered by tests
blk = Block((b1, B...))
view(C, to_indices(C, (blk,))...)
end
Base.@propagate_inbounds function Base.view(C::CartesianIndices{N}, B::Block{N}) where {N}
@propagate_inbounds function view(C::CartesianIndices{N}, B::Block{N}) where {N}

Check warning on line 122 in src/blockindices.jl

View check run for this annotation

Codecov / codecov/patch

src/blockindices.jl#L122

Added line #L122 was not covered by tests
view(C, to_indices(C, (B,))...)
end

Expand Down Expand Up @@ -310,7 +310,7 @@
show(io::IO, r::BlockSlice) = print(io, "BlockSlice(", r.block, ",", r.indices, ")")

# Avoid creating a SubArray wrapper in certain non-allocating cases
Base.@propagate_inbounds Base.view(C::CartesianIndices{N}, bs::Vararg{BlockSlice,N}) where {N} = view(C, map(x->x.indices, bs)...)
@propagate_inbounds view(C::CartesianIndices{N}, bs::Vararg{BlockSlice,N}) where {N} = view(C, map(x->x.indices, bs)...)

Check warning on line 313 in src/blockindices.jl

View check run for this annotation

Codecov / codecov/patch

src/blockindices.jl#L313

Added line #L313 was not covered by tests

Block(bs::BlockSlice{<:BlockIndexRange}) = Block(bs.block)

Expand Down
Loading