From 6ab6321c2fa9d84c798a5f133811a76517953fe2 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Thu, 7 Oct 2021 20:12:32 +0330 Subject: [PATCH] LibJS: Remove redundant const_cast The accessed field is mutable, so there's no need for this const_cast. --- Userland/Libraries/LibJS/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 8eb93d3ded..3b9ca881fc 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -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(*this).m_cached_environment_coordinate = reference.environment_coordinate(); + m_cached_environment_coordinate = reference.environment_coordinate(); return reference; }