From 03a4ad8e53d36f361704b6eb7959e8b4738ba9a7 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 28 Apr 2013 23:13:35 -0400 Subject: [PATCH] Another loop / goodie. Needed a new header though. --- src/Command.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Command.cpp b/src/Command.cpp index 74ef49c8c4..3a5df0c9e9 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -4,7 +4,7 @@ #include "RageLog.h" #include "arch/Dialog/Dialog.h" #include "Foreach.h" - +#include RString Command::GetName() const { @@ -81,10 +81,14 @@ static void SplitWithQuotes( const RString sSource, const char Delimitor, vector RString Commands::GetOriginalCommandString() const { +#ifdef MACOSX RString s; - FOREACH_CONST( Command, v, c ) - s += c->GetOriginalCommandString(); + for (Command const &c : v) + s += c.GetOriginalCommandString(); return s; +#else + return std::accumulate(v.begin(), v.end(), RString(), [](RString &res, Command const &c) { return res += c.GetOriginalCommandString(); }); +#endif } void ParseCommands( const RString &sCommands, Commands &vCommandsOut )