DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=23924>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=23924 Enhanced performance for TagUtils.filter() ------- Additional Comments From [EMAIL PROTECTED] 2004-07-23 01:52 ------- Sean, I only see two additional objects being allocated (rather than three) - the StringBuffer and the char[] copy of the String. Seems to me that copying the String to a char[] is unnecessary and could be replaced using the String.charAt (index) function - so it would look like this: StringBuffer result = new StringBuffer(value.length() + 50); for (int i = 0; i < value.length(); i++) { switch (value.charAt(i)) { case '<': result.append("<"); break; case '>': result.append(">"); break; case '&': result.append("&"); break; case '"': result.append("""); break; case '\'': result.append("'"); break; default: result.append(value.charAt(i)); } I agree with Steve, better to keep this simple - any objections to me applying the above change and closing this bug? Niall --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]