mirror of
https://github.com/fangyidong/json-simple.git
synced 2025-12-06 15:30:54 +03:00
Cached original string length in JSONValue#escape to avoid repeated calls to String#length.
This commit is contained in:
@@ -321,7 +321,8 @@ public class JSONValue {
|
||||
* @param sb
|
||||
*/
|
||||
static void escape(String s, StringBuffer sb) {
|
||||
for(int i=0;i<s.length();i++){
|
||||
final int len = s.length();
|
||||
for(int i=0;i<len;i++){
|
||||
char ch=s.charAt(i);
|
||||
switch(ch){
|
||||
case '"':
|
||||
|
||||
Reference in New Issue
Block a user