Skip to content

Commit

Permalink
no regex iteration
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege <[email protected]>
  • Loading branch information
mherwege committed Jun 19, 2023
1 parent ca7fff2 commit 6cf1d6e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ private QuantityType<?> convertStateToWidgetUnit(QuantityType<?> quantityState,
if (item instanceof NumberItem numberItem && numberItem.getDimension() != null) {
Matcher m = FORMAT_PATTERN.matcher(pattern);
int matcherEnd = 0;
while (m.find() && m.group(1) == null) {
if (m.matches() && m.group(1) == null) {
matcherEnd = m.end();
}
String unit = pattern.substring(matcherEnd).trim();
Expand Down

0 comments on commit 6cf1d6e

Please sign in to comment.