Skip to content

Commit c2a387e

Browse files
Merge pull request #282 from mateuszbaran/mbaran/fix-277
Fix `iszero`
2 parents d9a3a7a + 7e8a720 commit c2a387e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/array_partition.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Base.any(f, A::ArrayPartition) = any(f, (any(f, x) for x in A.x))
169169
Base.any(f::Function, A::ArrayPartition) = any(f, (any(f, x) for x in A.x))
170170
Base.any(A::ArrayPartition) = any(identity, A)
171171
Base.all(f, A::ArrayPartition) = all(f, (all(f, x) for x in A.x))
172-
Base.all(f::Function, A::ArrayPartition) = all(f, (all(f, x) for x in A.x))
172+
Base.all(f::Function, A::ArrayPartition) = all((all(f, x) for x in A.x))
173173
Base.all(A::ArrayPartition) = all(identity, A)
174174

175175
function Base.copyto!(dest::AbstractArray, A::ArrayPartition)

test/partitions_test.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ end
243243
@test zero(a) == ArrayPartition(zeros(Int, 0, 0), zeros(Float32, 0, 0))
244244
end
245245

246+
@test !iszero(ArrayPartition([2], [3, 4]))
246247
@testset "Cartesian indexing" begin
247248
@test ArrayPartition([1,2], [3])[1:3,1] == [1, 2, 3]
248249
end

0 commit comments

Comments
 (0)