I'd say that this should be benchmarked before refactoring. If this is compiled away, it should not generate much overhead. (But LuaJIT can be finicky in that matter...)