Fix Table::raw_len
This commit is contained in:
parent
6a0393f346
commit
19ee453172
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue