Skip to content

Commit

Permalink
若干代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed May 5, 2024
1 parent 235ec3f commit 633e886
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extend/luaxml/src/luaxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using namespace tinyxml2;

namespace luaxml {

static void save2lua_elem(lua_State* L, const XMLElement* elem) {
static void push_elem2lua(lua_State* L, const XMLElement* elem) {
int index = 1;
while (elem) {
lua_createtable(L, 0, 4);
Expand All @@ -30,7 +30,7 @@ namespace luaxml {
const XMLElement* child = elem->FirstChildElement();
if (child) {
lua_newtable(L);
save2lua_elem(L, child);
push_elem2lua(L, child);
lua_setfield(L, -2, "_elems");
}
lua_seti(L, -2, index++);
Expand All @@ -46,7 +46,7 @@ namespace luaxml {
return 2;
}
lua_newtable(L);
save2lua_elem(L, doc.RootElement());
push_elem2lua(L, doc.RootElement());
return 1;
}

Expand All @@ -58,7 +58,7 @@ namespace luaxml {
return 2;
}
lua_newtable(L);
save2lua_elem(L, doc.RootElement());
push_elem2lua(L, doc.RootElement());
return 1;
}

Expand Down

0 comments on commit 633e886

Please sign in to comment.