diff --git a/cpp/QrSegment.cpp b/cpp/QrSegment.cpp index 2a0f713..2579e05 100644 --- a/cpp/QrSegment.cpp +++ b/cpp/QrSegment.cpp @@ -115,7 +115,7 @@ QrSegment QrSegment::makeAlphanumeric(const char *text) { vector QrSegment::makeSegments(const char *text) { // Select the most efficient segment encoding automatically vector result; - if (*text == '\0'); // Leave the vector empty + if (*text == '\0'); // Leave result empty else if (isNumeric(text)) result.push_back(makeNumeric(text)); else if (isAlphanumeric(text)) diff --git a/java/io/nayuki/qrcodegen/QrSegment.java b/java/io/nayuki/qrcodegen/QrSegment.java index 9c4bacd..708be71 100644 --- a/java/io/nayuki/qrcodegen/QrSegment.java +++ b/java/io/nayuki/qrcodegen/QrSegment.java @@ -118,8 +118,7 @@ public final class QrSegment { // Select the most efficient segment encoding automatically List result = new ArrayList<>(); - if (text.equals("")) - return result; + if (text.equals("")); // Leave result empty else if (NUMERIC_REGEX.matcher(text).matches()) result.add(makeNumeric(text)); else if (ALPHANUMERIC_REGEX.matcher(text).matches())