Tweaked Java and C++ code and comment slightly.

This commit is contained in:
Project Nayuki 2017-08-26 18:57:52 +00:00
parent 6b2cfd98dc
commit 6dfb842afa
2 changed files with 2 additions and 3 deletions

View File

@ -115,7 +115,7 @@ QrSegment QrSegment::makeAlphanumeric(const char *text) {
vector<QrSegment> QrSegment::makeSegments(const char *text) {
// Select the most efficient segment encoding automatically
vector<QrSegment> 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))

View File

@ -118,8 +118,7 @@ public final class QrSegment {
// Select the most efficient segment encoding automatically
List<QrSegment> 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())