You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:47:05 UTC

[sling-org-apache-sling-jcr-contentparser] 03/07: SLING-6872 small optimization: set initial stringbuilder capacity

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.contentparser-1.2.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentparser.git

commit 042bb3710c0b2b0805fc0d1f9fb1c31dbbfbde65
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue May 23 21:36:01 2017 +0000

    SLING-6872 small optimization: set initial stringbuilder capacity
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentparser@1795970 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/jcr/contentparser/impl/JsonTicksConverter.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/contentparser/impl/JsonTicksConverter.java b/src/main/java/org/apache/sling/jcr/contentparser/impl/JsonTicksConverter.java
index 6125599..9d5f6e0 100644
--- a/src/main/java/org/apache/sling/jcr/contentparser/impl/JsonTicksConverter.java
+++ b/src/main/java/org/apache/sling/jcr/contentparser/impl/JsonTicksConverter.java
@@ -32,11 +32,12 @@ package org.apache.sling.jcr.contentparser.impl;
 class JsonTicksConverter {
     
     static String tickToDoubleQuote(final String input) {
-        final StringBuilder output = new StringBuilder();
+        final int len = input.length();
+        final StringBuilder output = new StringBuilder(len);
         boolean quoted = false;
         boolean tickQuoted = false;
         boolean escaped = false;
-        for (int i = 0, len = input.length(); i < len; i++) {
+        for (int i = 0; i < len; i++) {
             char in = input.charAt(i);
             if (quoted || tickQuoted) {
                 if (escaped) {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.