From a3b5b26c0a719c7b39f5f73c7b933f882d2df7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Thu, 18 Nov 2021 10:23:45 +0200 Subject: [PATCH] Eliminate loop in setnodekey and getnodekey in hope that this produces better code in debug. --- VM/src/lobject.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/VM/src/lobject.h b/VM/src/lobject.h index 24fe54ee..cac1e5f4 100644 --- a/VM/src/lobject.h +++ b/VM/src/lobject.h @@ -394,8 +394,7 @@ typedef struct LuaNode LuaNode* n_ = (node); \ const TValue* i_o = (obj); \ n_->key.value = i_o->value; \ - for (int i = 0; i < LUA_EXTRA_VALUE_SIZE; i++) \ - n_->key.extra[i] = i_o->extra[i]; \ + memcpy(n_->key.extra, i_o->extra, sizeof(n_->key.extra)); \ n_->key.tt = i_o->tt; \ checkliveness(L->global, i_o); \ } @@ -406,8 +405,7 @@ typedef struct LuaNode TValue* i_o = (obj); \ const LuaNode* n_ = (node); \ i_o->value = n_->key.value; \ - for (int i = 0; i < LUA_EXTRA_VALUE_SIZE; i++) \ - i_o->extra[i] = n_->key.extra[i]; \ + memcpy(i_o->extra, n_->key.extra, sizeof(i_o->extra)); \ i_o->tt = n_->key.tt; \ checkliveness(L->global, i_o); \ }