Skip to content

Commit 1bebd08

Browse files
committed
Separate populating and checking if tempVars is empty
1 parent ada293f commit 1bebd08

File tree

1 file changed

+3
-3
lines changed
  • src/main/java/org/culturegraph/mf/morph/functions

1 file changed

+3
-3
lines changed

src/main/java/org/culturegraph/mf/morph/functions/Regexp.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,22 @@ public void receive(final String name, final String value, final NamedValueSourc
4949
}
5050
} else {
5151
while (matcher.find()) {
52-
if (!matchAndFormatIsEmpty()) {
52+
populateVars();
53+
if (!tempVars.isEmpty()) {
5354
getNamedValueReceiver().receive(name,
5455
StringUtil.format(format, tempVars), source, recordCount, entityCount);
5556
}
5657
}
5758
}
5859
}
5960

60-
private boolean matchAndFormatIsEmpty() {
61+
private void populateVars() {
6162
tempVars.clear();
6263
for (int i = 0; i <= matcher.groupCount(); ++i) {
6364
if (!matcher.group(i).isEmpty()) {
6465
tempVars.put(String.valueOf(i), matcher.group(i));
6566
}
6667
}
67-
return tempVars.isEmpty();
6868
}
6969

7070
/**

0 commit comments

Comments
 (0)