Skip to content

Commit 2564fc1

Browse files
committed
Simplify
1 parent e01ec21 commit 2564fc1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/tangent_types/thunks.jl

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const UTILIZE_THUNKS = Ref{Function}(() -> true)
2-
@noinline utilize_thunks() = UTILIZE_THUNKS[]()
32

43
abstract type AbstractThunk <: AbstractTangent end
54

@@ -145,7 +144,7 @@ macro thunk(body)
145144
# so we get useful stack traces if it errors.
146145
func = Expr(:->, Expr(:tuple), Expr(:block, __source__, body))
147146
return quote
148-
$(esc(utilize_thunks))() ?
147+
$(esc(UTILIZE_THUNKS))[]() ?
149148
Thunk($(esc(func))) :
150149
$(esc(func))()
151150
end
@@ -242,7 +241,7 @@ struct InplaceableThunk{T<:Thunk,F} <: AbstractThunk
242241
val::T
243242

244243
function InplaceableThunk(add!::F, val::T) where {F, T}
245-
utilize_thunks() ?
244+
UTILIZE_THUNKS[]() ?
246245
new{T, F}(add!, val) :
247246
val
248247
end

0 commit comments

Comments
 (0)