diff options
author | Hk-tang <hktang@ualberta.ca> | 2020-04-06 08:38:29 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 17:38:29 +0300 |
commit | f6a9a9ad489be81bb7327096b038cc6b63cfa39a (patch) | |
tree | 9c64ff6dd082997133de897f0e9dacc5f4d049a9 | |
parent | a281d73fc2d00a52e7b0dc3f1da060f80391cfb8 (diff) | |
download | vaadin-framework-f6a9a9ad489be81bb7327096b038cc6b63cfa39a.tar.gz vaadin-framework-f6a9a9ad489be81bb7327096b038cc6b63cfa39a.zip |
Change to using StringBuilder (#11941)
Should use a StringBuilder to accumulate strings in a loop, to avoid the performance cost of repeatedly constructing strings.
-rw-r--r-- | server/src/main/java/com/vaadin/ui/declarative/Design.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/main/java/com/vaadin/ui/declarative/Design.java b/server/src/main/java/com/vaadin/ui/declarative/Design.java index 0b78a9cbde..a2c698c6bd 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/Design.java +++ b/server/src/main/java/com/vaadin/ui/declarative/Design.java @@ -234,14 +234,14 @@ public class Design implements Serializable { throw new DesignException("Unknown tag: " + tagName); } String[] classNameParts = parts[1].split("-"); - String className = ""; + StringBuilder className = new StringBuilder(); for (String classNamePart : classNameParts) { // Split will ignore trailing and multiple dashes but that // should be // ok // <vaadin-button--> will be resolved to <vaadin-button> // <vaadin--button> will be resolved to <vaadin-button> - className += SharedUtil.capitalize(classNamePart); + className.append(SharedUtil.capitalize(classNamePart)); } String qualifiedClassName = packageName + "." + className; |