From 3b6ddce4976037cbbdf0bad2f5cf8ed228783982 Mon Sep 17 00:00:00 2001 From: andreoss Date: Fri, 16 Oct 2020 17:33:56 +0300 Subject: [PATCH] (#1462) Use `text.Mapped` --- src/main/java/org/cactoos/text/SwappedCase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cactoos/text/SwappedCase.java b/src/main/java/org/cactoos/text/SwappedCase.java index ab202d1659..a38e0825f1 100644 --- a/src/main/java/org/cactoos/text/SwappedCase.java +++ b/src/main/java/org/cactoos/text/SwappedCase.java @@ -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]; @@ -51,7 +50,8 @@ public SwappedCase(final Text text) { } } return new String(chars); - } + }, + text ) ); }