From e50be24f036046f9c1d044f696a4b790055be5b8 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Sat, 2 Aug 2025 04:23:14 +0900 Subject: [PATCH] Test: remove unnecessary allocation --- stdlib/Test/src/Test.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/Test/src/Test.jl b/stdlib/Test/src/Test.jl index 09594e5be0025..e6e0c9f4915a5 100644 --- a/stdlib/Test/src/Test.jl +++ b/stdlib/Test/src/Test.jl @@ -1351,7 +1351,7 @@ function finish(ts::DefaultTestSet; print_results::Bool=TESTSET_PRINT_ENABLE[]) end # return the testset so it is returned from the @testset macro - ts + return ts end # Recursive function that finds the column that the result counts @@ -1375,15 +1375,15 @@ get_alignment(ts, depth::Int) = 0 # Recursive function that fetches backtraces for any and all errors # or failures the testset and its children encountered function filter_errors(ts::DefaultTestSet) - efs = [] + efs = Any[] for t in ts.results if isa(t, DefaultTestSet) append!(efs, filter_errors(t)) elseif isa(t, Union{Fail, Error}) - append!(efs, [t]) + push!(efs, t) end end - efs + return efs end """