You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Daniel Gredler (JIRA)" <ji...@apache.org> on 2006/07/29 01:15:15 UTC

[jira] Created: (SANDBOX-160) small optimization in CSVPrinter#print(String)

small optimization in CSVPrinter#print(String)
----------------------------------------------

                 Key: SANDBOX-160
                 URL: http://issues.apache.org/jira/browse/SANDBOX-160
             Project: Commons Sandbox
          Issue Type: Improvement
          Components: CSV
    Affects Versions: Nightly Builds
            Reporter: Daniel Gredler
            Priority: Trivial


The following code in CSVPrinter#print(String) could use a break:

for (int i = 0; i < value.length(); i++) {
    c = value.charAt(i);
    if (c == '"' || c == this.strategy.getDelimiter() || c == '\n' || c == '\r') {
        quote = true;
        >>> BREAK OUT OF LOOP HERE <<<
    }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (SANDBOX-160) small optimization in CSVPrinter#print(String)

Posted by "Daniel Gredler (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/SANDBOX-160?page=comments#action_12424219 ] 
            
Daniel Gredler commented on SANDBOX-160:
----------------------------------------

Note that the code immediately below this loop expects char c to be the last char in the string, so you would have to add a line below the loop:

c = value.charAt( value.length() - 1 );

> small optimization in CSVPrinter#print(String)
> ----------------------------------------------
>
>                 Key: SANDBOX-160
>                 URL: http://issues.apache.org/jira/browse/SANDBOX-160
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: CSV
>    Affects Versions: Nightly Builds
>            Reporter: Daniel Gredler
>            Priority: Trivial
>
> The following code in CSVPrinter#print(String) could use a break:
> for (int i = 0; i < value.length(); i++) {
>     c = value.charAt(i);
>     if (c == '"' || c == this.strategy.getDelimiter() || c == '\n' || c == '\r') {
>         quote = true;
>         >>> BREAK OUT OF LOOP HERE <<<
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (SANDBOX-160) small optimization in CSVPrinter#print(String)

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/SANDBOX-160?page=all ]

Henri Yandell resolved SANDBOX-160.
-----------------------------------

    Resolution: Fixed

Thanks Daniel, should be in tonight's nightly build. Or tomorrow night's if my commit was just too late.

svn ci -m "Adding a minor optimisation as detailed in #SANDBOX-160 by Daniel Gred
ler. " src/java/org/apache/commons/csv/CSVPrinter.java 
Sending        src/java/org/apache/commons/csv/CSVPrinter.java
Transmitting file data .
Committed revision 427471.

> small optimization in CSVPrinter#print(String)
> ----------------------------------------------
>
>                 Key: SANDBOX-160
>                 URL: http://issues.apache.org/jira/browse/SANDBOX-160
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: CSV
>    Affects Versions: Nightly Builds
>            Reporter: Daniel Gredler
>            Priority: Trivial
>
> The following code in CSVPrinter#print(String) could use a break:
> for (int i = 0; i < value.length(); i++) {
>     c = value.charAt(i);
>     if (c == '"' || c == this.strategy.getDelimiter() || c == '\n' || c == '\r') {
>         quote = true;
>         >>> BREAK OUT OF LOOP HERE <<<
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org