Skip to content

Commit

Permalink
(yegor256#1462) Use text.Mapped
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed Oct 16, 2020
1 parent a0e1eb9 commit f7cbbd6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/cactoos/text/Strict.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ public Strict(final Pattern pattern, final Text origin) {
*/
public Strict(final Func<String, Boolean> predicate, final Text origin) {
super(
new TextOf(
() -> {
final String str = origin.asString();
new Mapped(
str -> {
if (!predicate.apply(str)) {
throw new IllegalArgumentException(
new FormattedText(
Expand All @@ -64,7 +63,8 @@ public Strict(final Func<String, Boolean> predicate, final Text origin) {
);
}
return str;
}
},
origin
)
);
}
Expand Down

0 comments on commit f7cbbd6

Please sign in to comment.