diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-03-03 21:11:18 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-03-03 22:14:49 (GMT) |
commit | 12024229138787d7df91cb8101d0986996880e3d (patch) | |
tree | 575ef4bd2104ce4a0531580ac78381dbb94f6c6e /Sluift/Lua | |
parent | a8cd6a5cbf74d0db4df0b7daa8e4b1b0e0bc00d0 (diff) | |
download | swift-12024229138787d7df91cb8101d0986996880e3d.zip swift-12024229138787d7df91cb8101d0986996880e3d.tar.bz2 |
Some more Sluift tweaks.
Diffstat (limited to 'Sluift/Lua')
-rw-r--r-- | Sluift/Lua/Value.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Sluift/Lua/Value.cpp b/Sluift/Lua/Value.cpp index b612bd9..8dd8fcc 100644 --- a/Sluift/Lua/Value.cpp +++ b/Sluift/Lua/Value.cpp @@ -36,11 +36,10 @@ namespace { lua_pushstring(state, s.c_str());
}
- void operator()(const std::vector<Value>& list) const {
- lua_newtable(state);
- int i = 0;
- foreach(const Value& value, list) {
- boost::apply_visitor(PushVisitor(state), value);
+ void operator()(const std::vector<Value>& values) const {
+ lua_createtable(state, values.size(), 0);
+ for(size_t i = 0; i < values.size(); ++i) {
+ boost::apply_visitor(PushVisitor(state), values[i]);
lua_rawseti(state, -2, i + 1);
}
}
|