Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Changed the regex to a better one #12

Merged
merged 1 commit into from

2 participants

@pradyun

Now doesn't match empty strings, therefore faster. Sorry, forgot to do that in the earlier pull request... Really is change of one char, but makes a substantial difference..

@pradyun pradyun Changed the regex to a better one
Now doesn't match empty strings, therefore faster.
f209c1a
@getify getify merged commit 189ef1d into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 27, 2013
  1. @pradyun

    Changed the regex to a better one

    pradyun authored
    Now doesn't match empty strings, therefore faster.
This page is out of date. Refresh to see the latest.
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()
Something went wrong with that request. Please try again.