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 d6513dd commit 3b6ddce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/cactoos/text/SwappedCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ public final class SwappedCase extends TextEnvelope {
*/
public SwappedCase(final Text text) {
super(
new TextOf(
() -> {
final String origin = text.asString();
new Mapped(
origin -> {
final char[] chars = origin.toCharArray();
for (int idx = 0; idx < chars.length; idx += 1) {
final char chr = chars[idx];
Expand All @@ -51,7 +50,8 @@ public SwappedCase(final Text text) {
}
}
return new String(chars);
}
},
text
)
);
}
Expand Down

0 comments on commit 3b6ddce

Please sign in to comment.