@@ -1218,8 +1218,7 @@ auto Parser::ParsePositionalSuffix(
1218
1218
// arguments.
1219
1219
bool empty_positional = false ;
1220
1220
while (!unparsed_args.empty ()) {
1221
- llvm::StringRef unparsed_arg = unparsed_args.front ();
1222
- unparsed_args = unparsed_args.drop_front ();
1221
+ llvm::StringRef unparsed_arg = unparsed_args.consume_front ();
1223
1222
1224
1223
if (unparsed_arg != " --" ) {
1225
1224
CARBON_RETURN_IF_ERROR (ParsePositionalArg (unparsed_arg));
@@ -1260,11 +1259,9 @@ auto Parser::Parse(llvm::ArrayRef<llvm::StringRef> unparsed_args)
1260
1259
PopulateMaps (*command_);
1261
1260
1262
1261
while (!unparsed_args.empty ()) {
1263
- llvm::StringRef unparsed_arg = unparsed_args.front ();
1264
-
1265
1262
// Peak at the front for an exact `--` argument that switches to a
1266
1263
// positional suffix parsing without dropping this argument.
1267
- if (unparsed_arg == " --" ) {
1264
+ if (unparsed_args. front () == " --" ) {
1268
1265
if (command_->positional_args .empty ()) {
1269
1266
return Error (
1270
1267
" cannot meaningfully end option and subcommand arguments with a "
@@ -1284,7 +1281,7 @@ auto Parser::Parse(llvm::ArrayRef<llvm::StringRef> unparsed_args)
1284
1281
1285
1282
// Now that we're not switching parse modes, drop the current unparsed
1286
1283
// argument and parse it.
1287
- unparsed_args = unparsed_args.drop_front ();
1284
+ llvm::StringRef unparsed_arg = unparsed_args.consume_front ();
1288
1285
1289
1286
if (unparsed_arg.starts_with (" --" )) {
1290
1287
// Note that the exact argument "--" has been handled above already.
0 commit comments