Skip to content

Commit

Permalink
(yegor256#1462) Make Split evaluating lazily its parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
victornoel authored and Olivier B. OURA committed Jan 8, 2021
1 parent 23372c2 commit 5db9915
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/cactoos/text/Split.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.cactoos.iterable.IterableEnvelope;
import org.cactoos.iterable.IterableOf;
import org.cactoos.iterable.Mapped;
import org.cactoos.iterator.IteratorOf;

/**
* Split the Text.
Expand Down Expand Up @@ -151,7 +152,7 @@ public Split(final UncheckedText text, final UncheckedText rgx, final int lmt) {
new Mapped<>(
TextOf::new,
new IterableOf<>(
text.asString().split(rgx.asString(), lmt)
() -> new IteratorOf<>(text.asString().split(rgx.asString(), lmt))
)
)
);
Expand Down

0 comments on commit 5db9915

Please sign in to comment.