Skip to content
Browse files

Changed the regex to a better one

Now doesn't match empty strings, therefore faster.
  • Loading branch information...
1 parent 38e7efc commit f209c1a991922c6f88327f9df920d02472a2aedb @pradyunsg pradyunsg committed Sep 27, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 minify_json.py
View
2 minify_json.py
@@ -29,7 +29,7 @@ def json_minify(string, strip_space=True):
tmp = string[index:match.start()]
if not in_string and strip_space:
# replace white space as defined in standard
- tmp = re.sub('[ \t\n\r]*', '', tmp)
+ tmp = re.sub('[ \t\n\r]+', '', tmp)
new_str.append(tmp)
index = match.end()

0 comments on commit f209c1a

Please sign in to comment.
Something went wrong with that request. Please try again.