From e2050c3e03f8a7d1839580ec527f0c4524938ee8 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Sat, 25 Aug 2018 23:23:26 +0000 Subject: [PATCH] Simplified code to use StringBuilder method chaining. --- src/io/nayuki/fastqrcodegen/QrCode.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/io/nayuki/fastqrcodegen/QrCode.java b/src/io/nayuki/fastqrcodegen/QrCode.java index f611a13..7124f6a 100644 --- a/src/io/nayuki/fastqrcodegen/QrCode.java +++ b/src/io/nayuki/fastqrcodegen/QrCode.java @@ -209,14 +209,13 @@ public final class QrCode { if (size + border * 2L > Integer.MAX_VALUE) throw new IllegalArgumentException("Border too large"); - StringBuilder sb = new StringBuilder(); - sb.append("\n"); - sb.append("\n"); - sb.append(String.format( - "\n", - size + border * 2)); - sb.append("\t\n"); - sb.append("\t\n") + .append("\n") + .append(String.format("\n", + size + border * 2)) + .append("\t\n") + .append("\t\n"); - sb.append("\n"); - return sb.toString(); + return sb + .append("\" fill=\"#000000\"/>\n") + .append("\n") + .toString(); }