We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8385da4 commit adff9bcCopy full SHA for adff9bc
src/Equation.jl
@@ -190,8 +190,19 @@ const OP_NAMES = Dict(
190
"safe_pow" => "^",
191
)
192
193
-function get_op_name(op::String)
194
- return get(OP_NAMES, op, op)
+@generated function get_op_name(op::F) where {F}
+ try
195
+ # Bit faster to just cache the name of the operator:
196
+ op_s = string(F.instance)
197
+ out = get(OP_NAMES, op_s, op_s)
198
+ return :($out)
199
+ catch
200
+ end
201
+ return quote
202
+ op_s = string(op)
203
204
+ return out
205
206
end
207
208
function string_op(
0 commit comments