godot
godot copied to clipboard
GDScriptVM: Avoid c-style cast/const_cast
+replaced c-style casts with more verbose and searchable c++ casts
+moved common const_cast of instruction_args to const Variant ** into a ref var
What is the benefit for this code style change?
Edited: it's not very long so it's probably ok and localized to gdscript
im searching for const_casts after https://github.com/godotengine/godot/issues/93759, and trying to find ways to remove them or improve them, this is just a style change. bc of how Vector and CowData might(?) copy the data if stack.ptrw() was used. i didn't want to touch that
the style guide doesnt say anything about casts, but im assuming moving away from c-style casts toward verbose casts is desired