From 269e89387480f097ec20f467cd0cacdc1c71f3b7 Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Wed, 28 Jan 2026 20:40:58 +0100 Subject: [PATCH] Delete unnecessary `lastindex()` method --- Project.toml | 2 +- src/array_partition.jl | 1 - test/partitions_test.jl | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 9d263c7c..28f7e6ff 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RecursiveArrayTools" uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" authors = ["Chris Rackauckas "] -version = "3.46.0" +version = "3.46.1" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/src/array_partition.jl b/src/array_partition.jl index a90ba108..ffaadb89 100644 --- a/src/array_partition.jl +++ b/src/array_partition.jl @@ -280,7 +280,6 @@ end # Interface for the linear indexing. This is just a view of the underlying nested structure @inline Base.firstindex(A::ArrayPartition) = 1 -@inline Base.lastindex(A::ArrayPartition) = length(A) Base.@propagate_inbounds function Base.getindex(A::ArrayPartition, i::Int) @boundscheck checkbounds(A, i) diff --git a/test/partitions_test.jl b/test/partitions_test.jl index 53429740..3d81753a 100644 --- a/test/partitions_test.jl +++ b/test/partitions_test.jl @@ -135,6 +135,7 @@ y = ArrayPartition(ArrayPartition([1], [2.0]), ArrayPartition([3], [4.0])) # indexing @inferred first(x) @inferred last(x) +@test lastindex(x) == length(x) # recursive @inferred recursive_mean(x)