From ead42d52345f645d65725ab823d11397354795e3 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 30 Apr 2013 20:45:40 -0400 Subject: [PATCH] Update these loops. --- src/LuaManager.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp index d3f95ff428..ec75f43507 100644 --- a/src/LuaManager.cpp +++ b/src/LuaManager.cpp @@ -670,10 +670,10 @@ XNode *LuaHelpers::GetLuaInformation() /* Globals */ sort( vFunctions.begin(), vFunctions.end() ); - FOREACH_CONST( RString, vFunctions, func ) + for (RString const &func : vFunctions) { XNode *pFunctionNode = pGlobalsNode->AppendChild( "Function" ); - pFunctionNode->AppendAttr( "name", *func ); + pFunctionNode->AppendAttr( "name", func ); } /* Classes */ @@ -708,10 +708,10 @@ XNode *LuaHelpers::GetLuaInformation() const vector &vNamespace = iter->second; pNamespaceNode->AppendAttr( "name", iter->first ); - FOREACH_CONST( RString, vNamespace, func ) + for (RString const &func: vNamespace) { XNode *pFunctionNode = pNamespaceNode->AppendChild( "Function" ); - pFunctionNode->AppendAttr( "name", *func ); + pFunctionNode->AppendAttr( "name", func ); } } @@ -861,9 +861,8 @@ void LuaHelpers::ParseCommandList( Lua *L, const RString &sCommands, const RStri s << "return function(self)\n"; - FOREACH_CONST( Command, cmds.v, c ) + for (Command const &cmd : cmds.v) { - const Command& cmd = (*c); RString local_sName = cmd.GetName(); s << "\tself:" << local_sName << "(";