From 66fafaaaf3cc37513826dd5a63295a8b58720c25 Mon Sep 17 00:00:00 2001 From: Erin Maus Date: Wed, 24 Jun 2026 19:37:04 -0400 Subject: [PATCH] Use `getMatrix().inverse() instead of heap allocation.` --- src/modules/math/wrap_Transform.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/math/wrap_Transform.cpp b/src/modules/math/wrap_Transform.cpp index 993360f23..f27466e8f 100644 --- a/src/modules/math/wrap_Transform.cpp +++ b/src/modules/math/wrap_Transform.cpp @@ -145,9 +145,7 @@ int w_Transform_inverseOf(lua_State *L) { Transform *destination = luax_checktransform(L, 1); Transform *source = luax_checktransform(L, 2); - Transform *inverseSource = source->inverse(); - destination->setMatrix(inverseSource->getMatrix()); - inverseSource->release(); + destination->setMatrix(source->getMatrix().inverse()); lua_pushvalue(L, 1); return 1; }