Skip to content

Commit 3656043

Browse files
committed
Add push_into_stack_multi fastpath to Variadic
1 parent 763c2b2 commit 3656043

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/multi.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,15 @@ impl<T: IntoLua> IntoLuaMulti for Variadic<T> {
297297
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue> {
298298
MultiValue::from_lua_iter(lua, self)
299299
}
300+
301+
unsafe fn push_into_stack_multi(self, lua: &RawLua) -> Result<c_int> {
302+
let nresults = self.len() as i32;
303+
check_stack(lua.state(), nresults + 1)?;
304+
for value in self.0 {
305+
value.push_into_stack(lua)?;
306+
}
307+
Ok(nresults)
308+
}
300309
}
301310

302311
impl<T: FromLua> FromLuaMulti for Variadic<T> {

0 commit comments

Comments
 (0)