Skip to content
Permalink
Browse files
Merge pull request #172 from kamaci/fix/performance_string_concatenation
[ANY23-465] StringBuilder is Used Instead of String Concatenation at Loop
  • Loading branch information
HansBrende committed Apr 23, 2021
2 parents 1efe1ff + 1b906fa commit 09e4322b4dd6153135c4090d7750f00562150195
Showing 1 changed file with 3 additions and 3 deletions.
@@ -75,10 +75,10 @@ public static TextField readTextField(Node node) {
// first check if there are values inside
List<Node> values = DomUtils.findAllByClassName(node, "value");
if (!values.isEmpty()) {
String val = "";
StringBuilder val = new StringBuilder();
for (Node n : values)
val += n.getTextContent();
return new TextField(val.trim(), node);
val.append(n.getTextContent());
return new TextField(val.toString().trim(), node);
}
if ("ABBR".equals(name) && (null != attributes.getNamedItem("title"))) {
result = new TextField(attributes.getNamedItem("title").getNodeValue(), node);

0 comments on commit 09e4322

Please sign in to comment.