We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c22febe commit 6790592Copy full SHA for 6790592
src/main/java/com/shapesecurity/shift/es2017/parser/PatternAcceptor.java
@@ -162,9 +162,10 @@ public String collect(@Nonnull String[]... stringArrays) {
162
163
public String collect(Maybe<Integer> limit, @Nonnull String[]... stringArrays) {
164
StringBuilder stringBuilder = new StringBuilder();
165
-
+ boolean isJust = limit.isJust();
166
+ int justLimit = limit.fromJust();
167
outer:
- for (int i = 0; limit.isNothing() || limit.fromJust() > i; ++i) {
168
+ for (int i = 0; !isJust || justLimit > i; ++i) {
169
for (String[] strings : stringArrays) {
170
for (String string : strings) {
171
if (this.eat(string)) {
0 commit comments