Skip to content

Commit

Permalink
Use break instead of code duplication (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ath authored Jul 16, 2023
1 parent cf333b4 commit 1cdb8a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/parser/repeater/possessive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class PossessiveRepeatingParser<R> extends RepeatingParser<R, List<R>> {
while (elements.length < max) {
final result = delegate.parseOn(current);
if (result.isFailure) {
return current.success(elements);
break;
}
elements.add(result.value);
current = result;
Expand All @@ -97,7 +97,7 @@ class PossessiveRepeatingParser<R> extends RepeatingParser<R, List<R>> {
while (count < max) {
final result = delegate.fastParseOn(buffer, current);
if (result < 0) {
return current;
break;
}
current = result;
count++;
Expand Down

0 comments on commit 1cdb8a7

Please sign in to comment.