Per reviewer request, cast the other side.
I don't think this matters. As long as one or the other of these is a std::string, I get an operator== that looks at content rather than pointer equality. I picked casting the constant over casting the dynamic thing in hopes that the compiler would have a better chance at optimizing away any runtime cost. Deferring to reviewer.
This commit is contained in:
parent
aa8e1d5f1e
commit
88183eb484
@ -140,7 +140,7 @@ bool isOption(Context * ctx, const Value & v)
|
||||
if (evaluated_type.type != tString) {
|
||||
return false;
|
||||
}
|
||||
return evaluated_type.string.s == static_cast<std::string>("option");
|
||||
return static_cast<std::string>(evaluated_type.string.s) == "option";
|
||||
} catch (Error &) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user