Skip to content

Commit cbf3786

Browse files
authored
Merge pull request #276 from giordano/mg/btime-return
Make `@btime` correctly return the value of the expression in v1.8
2 parents bd02a60 + fae983b commit cbf3786

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BenchmarkTools"
22
uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
3-
version = "1.3"
3+
version = "1.3.1"
44

55
[deps]
66
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"

src/execution.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,11 @@ function generate_benchmark_definition(eval_module, out_vars, setup_vars, quote_
479479
invocation = :($(Expr(:tuple, out_vars...)) = $(signature))
480480
core_body = :($(core); $(returns))
481481
end
482-
if isdefined(Base, :donotdelete)
483-
invocation = :(Base.donotdelete($invocation))
482+
@static if isdefined(Base, :donotdelete)
483+
invocation = :(let x = $invocation
484+
Base.donotdelete(x)
485+
x
486+
end)
484487
end
485488
return Core.eval(eval_module, quote
486489
@noinline $(signature_def) = begin $(core_body) end

0 commit comments

Comments
 (0)