Skip to content

Commit

Permalink
Use break instead of code duplication (part 2) (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ath committed Jul 16, 2023
1 parent 1cdb8a7 commit 235fd02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/parser/repeater/separated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class SeparatedRepeatingParser<R, S>
if (elements.isNotEmpty) {
final separation = separator.parseOn(current);
if (separation.isFailure) {
return current.success(SeparatedList(elements, separators));
break;
}
current = separation;
separators.add(separation.value);
Expand Down Expand Up @@ -126,7 +126,7 @@ class SeparatedRepeatingParser<R, S>
if (count > 0) {
final separation = separator.fastParseOn(buffer, current);
if (separation < 0) {
return current;
break;
}
current = separation;
}
Expand Down

0 comments on commit 235fd02

Please sign in to comment.