Skip to content

Commit 81352c1

Browse files
authored
Test: remove unnecessary allocation (#59186)
1 parent 698ae27 commit 81352c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/Test/src/Test.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ function finish(ts::DefaultTestSet; print_results::Bool=TESTSET_PRINT_ENABLE[])
13511351
end
13521352

13531353
# return the testset so it is returned from the @testset macro
1354-
ts
1354+
return ts
13551355
end
13561356

13571357
# Recursive function that finds the column that the result counts
@@ -1375,15 +1375,15 @@ get_alignment(ts, depth::Int) = 0
13751375
# Recursive function that fetches backtraces for any and all errors
13761376
# or failures the testset and its children encountered
13771377
function filter_errors(ts::DefaultTestSet)
1378-
efs = []
1378+
efs = Any[]
13791379
for t in ts.results
13801380
if isa(t, DefaultTestSet)
13811381
append!(efs, filter_errors(t))
13821382
elseif isa(t, Union{Fail, Error})
1383-
append!(efs, [t])
1383+
push!(efs, t)
13841384
end
13851385
end
1386-
efs
1386+
return efs
13871387
end
13881388

13891389
"""

0 commit comments

Comments
 (0)