1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

LibJS: Remove redundant const_cast

The accessed field is mutable, so there's no need for this const_cast.
This commit is contained in:
Ali Mohammad Pur 2021-10-07 20:12:32 +03:30 committed by Andreas Kling
parent 39baadcddf
commit 6ab6321c2f

View file

@ -1017,7 +1017,7 @@ Reference Identifier::to_reference(Interpreter& interpreter, GlobalObject&) cons
}
auto reference = interpreter.vm().resolve_binding(string());
if (reference.environment_coordinate().has_value())
const_cast<Identifier&>(*this).m_cached_environment_coordinate = reference.environment_coordinate();
m_cached_environment_coordinate = reference.environment_coordinate();
return reference;
}