Skip to content

Commit c335a54

Browse files
committed
run julia formatter
1 parent 0b96e24 commit c335a54

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ext/PreallocationToolsReverseDiffExt.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ using PreallocationTools
44
isdefined(Base, :get_extension) ? (import ReverseDiff) : (import ..ReverseDiff)
55

66
# PreallocationTools https://github.com/SciML/PreallocationTools.jl/issues/39
7-
function Base.getindex(b::PreallocationTools.LazyBufferCache, u::ReverseDiff.TrackedArray, s = b.sizemap(size(u)))
7+
function Base.getindex(b::PreallocationTools.LazyBufferCache,
8+
u::ReverseDiff.TrackedArray, s = b.sizemap(size(u)))
89
T = ReverseDiff.TrackedArray
910
buf = get!(b.bufs, (T, s)) do
1011
# declare type since b.bufs dictionary is untyped

src/PreallocationTools.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,18 @@ function similar_type(x::AbstractArray{T}, s::NTuple{N, Integer}) where {T, N}
219219
typeof(similar(x, ntuple(Returns(1), N)))
220220
end
221221

222-
function get_tmp(b::LazyBufferCache, u::T, s=b.sizemap(size(u))) where {T <: AbstractArray}
222+
function get_tmp(
223+
b::LazyBufferCache, u::T, s = b.sizemap(size(u))) where {T <: AbstractArray}
223224
get!(b.bufs, (T, s)) do
224225
similar(u, s) # buffer to allocate if it was not found in b.bufs
225226
end::similar_type(u, s) # declare type since b.bufs dictionary is untyped
226227
end
227228

228229
# override the [] method
229-
Base.getindex(b::LazyBufferCache, u::T, s=b.sizemap(size(u))) where {T <: AbstractArray} = get_tmp(b, u, s)
230+
function Base.getindex(
231+
b::LazyBufferCache, u::T, s = b.sizemap(size(u))) where {T <: AbstractArray}
232+
get_tmp(b, u, s)
233+
end
230234

231235
# GeneralLazyBufferCache
232236

0 commit comments

Comments
 (0)