Skip to content

Commit 24d8b5d

Browse files
committed
Better variable naming
1 parent 183b8b4 commit 24d8b5d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/src/utils/rest_args_with_separator.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ List<String> restArgsWithSeparator(ArgResults argResults) {
2525

2626
final args = argResults.arguments;
2727
final rest = argResults.rest;
28-
var rCursor = 0;
29-
for (var aCursor = 0; aCursor < args.length; aCursor++) {
28+
var restIndex = 0;
29+
for (var argsIndex = 0; argsIndex < args.length; argsIndex++) {
3030
// Iterate through the original args until we hit the first separator.
31-
if (args[aCursor] == '--') break;
31+
if (args[argsIndex] == '--') break;
3232
// While doing so, move a cursor through the rest args list each time we
3333
// match up between the original list and the rest args list. This works
3434
// because the rest args list should be an ordered subset of the original
3535
// args list.
36-
if (args[aCursor] == rest[rCursor]) {
37-
rCursor++;
36+
if (args[argsIndex] == rest[restIndex]) {
37+
restIndex++;
3838
}
3939
}
4040

41-
// At this point, [rCursor] should be pointing to the spot where the first arg
42-
// separator should be restored.
43-
return [...rest.sublist(0, rCursor), '--', ...rest.sublist(rCursor)];
41+
// At this point, [restIndex] should be pointing to the spot where the first
42+
// arg separator should be restored.
43+
return [...rest.sublist(0, restIndex), '--', ...rest.sublist(restIndex)];
4444
}

0 commit comments

Comments
 (0)