Skip to content

Commit

Permalink
Merge pull request #594 from JuliaSymbolics/b/replace_get!_with_get_t…
Browse files Browse the repository at this point in the history
…o_avoid_unnecessary_initialization_of_state_values

Replace `get!` with `get` to avoid unnecessary initialization of state values
  • Loading branch information
shashi authored May 7, 2024
2 parents e39b109 + 5320dd7 commit cc5eba3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/code.jl
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ end

function cse_state!(state, t)
!iscall(t) && return t
state[t] = Base.get!(state, t, 0) + 1
state[t] = Base.get(state, t, 0) + 1
foreach(x->cse_state!(state, x), unsorted_arguments(t))
end

Expand Down

0 comments on commit cc5eba3

Please sign in to comment.