Skip to content

Commit

Permalink
apply suggestions on simplifying the implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychen94 committed Nov 3, 2021
1 parent 42a2bdf commit 5fffa44
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions stdlib/LinearAlgebra/src/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,13 @@ number of BLAS threads.
function with_num_threads(f, num_threads::Integer)
prev_num_threads = BLAS.get_num_threads()
BLAS.set_num_threads(num_threads)
local retval
try
retval = f()
catch err
rethrow(err)
return f()
catch
rethrow()
finally
BLAS.set_num_threads(prev_num_threads)
end
return retval
end

# Level 1
Expand Down

0 comments on commit 5fffa44

Please sign in to comment.