Fix Table::raw_len

This commit is contained in:
SeanOMik 2024-01-23 20:31:51 -05:00
parent 6a0393f346
commit 19ee453172
Signed by: SeanOMik
GPG Key ID: FEC9E2FC15235964
1 changed files with 2 additions and 4 deletions

View File

@ -147,10 +147,8 @@ impl<'a> Table<'a> {
let s = self.state.state_ptr(); let s = self.state.state_ptr();
unsafe { unsafe {
self.lref.push_to_lua_stack(self.state)?; self.lref.push_to_lua_stack(self.state)?;
lua::lua_rawlen(s, -1); let len = lua::lua_rawlen(s, -1);
lua::lua_pop(s, -1); // pop table
let len = lua::lua_tonumber(s, -1);
lua::lua_pop(self.state.state_ptr(), -1);
Ok(len as u64) Ok(len as u64)
} }