Skip to content

Commit 397a8d5

Browse files
shashiYingboMa
andauthored
Update src/utils.jl
Co-authored-by: Yingbo Ma <[email protected]>
1 parent 22dee50 commit 397a8d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ end
3232

3333
function modelingtoolkitize_expr(ex::Symbol,vars,curmod)
3434
names = tosymbol.(vars)
35-
op = ex names ? vars[findfirst(x->(ex == tosymbol(x)),vars)] : getproperty(curmod,ex) # HACK
35+
idx = findfirst(x->ex == x, names)
36+
op = idx !== nothing ? vars[idx] : getproperty(curmod,ex)
3637
op
3738
end
3839

0 commit comments

Comments
 (0)