Changeset 12050


Ignore:
Timestamp:
2006-07-07T09:46:40+12:00 (18 years ago)
Author:
mdewsnip
Message:

(FindBugs) Changed stripNL() to use a StringBuffer instead of repeatedly concatenating onto a String.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r11630 r12050  
    386386    static public String stripNL(String raw_string)
    387387    {
    388     String stripped_string = new String();
     388    StringBuffer stripped_string_buffer = new StringBuffer();
    389389    for (int i = 0; i < raw_string.length(); i++) {
    390390        char raw_character = raw_string.charAt(i);
    391391        if (raw_character != '\n' && raw_character != '\t') {
    392         stripped_string = stripped_string + raw_character;
    393         }
    394     }
    395     return stripped_string;
     392        stripped_string_buffer.append(raw_character);
     393        }
     394    }
     395    return stripped_string_buffer.toString();
    396396    }
    397397}
Note: See TracChangeset for help on using the changeset viewer.