summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2017-02-23 09:23:41 -0500
committer Nathan Woods <npwoods@mess.org>2017-02-23 09:23:41 -0500
commit41c23502668b45d1d62b3f46e99731bd6e5e41a0 (patch)
treeaf01c1c1ea8c722df404a0232c6865bef64c9a11 /src
parent8c53c1438eb893ee9291c73e2ee26d34b5f8f2d7 (diff)
Vas feedback
Diffstat (limited to 'src')
-rw-r--r--src/frontend/mame/mame.cpp4
-rw-r--r--src/lib/util/options.cpp11
2 files changed, 4 insertions, 11 deletions
diff --git a/src/frontend/mame/mame.cpp b/src/frontend/mame/mame.cpp
index 10960cd0446..b99566ea5de 100644
--- a/src/frontend/mame/mame.cpp
+++ b/src/frontend/mame/mame.cpp
@@ -326,9 +326,7 @@ int emulator_info::start_frontend(emu_options &options, osd_interface &osd, std:
int emulator_info::start_frontend(emu_options &options, osd_interface &osd, int argc, char *argv[])
{
- std::vector<std::string> args(argc);
- for (int i = 0; i < argc; i++)
- args[i] = argv[i];
+ std::vector<std::string> args(argv, argv + argc);
return start_frontend(options, osd, args);
}
diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp
index 0f805c61a75..9cd9af1814c 100644
--- a/src/lib/util/options.cpp
+++ b/src/lib/util/options.cpp
@@ -516,14 +516,9 @@ std::string core_options::pluck_from_command_line(std::vector<std::string> &args
// get the result
result = std::move(args[i + 1]);
- // remove this arguments from the list (is there a standard
- // way to do this?)
- while (i < args.size() - 2)
- {
- args[i] = std::move(args[i + 2]);
- i++;
- }
- args.resize(args.size() - 2);
+ // remove this arguments from the list
+ auto const pos = std::advance(args.begin(), i);
+ args.erase(pos, std::advance(pos, 2));
break;
}
}