diff options
author | Tristan Seligmann <mithrandi@mithrandi.net> | 2017-07-09 17:37:42 +0200 |
---|---|---|
committer | Stefan Kögl <stefan@skoegl.net> | 2017-07-09 17:37:42 +0200 |
commit | e8fbd18d933f5d395576255208843808a875fd54 (patch) | |
tree | bb279b7642643a83664a07ef32abf8943854a03c | |
parent | 18887df8af5f761aa83c76a7cd3777210b2527ad (diff) | |
download | python-json-patch-e8fbd18d933f5d395576255208843808a875fd54.tar.gz |
Avoid double work (#62)
In the case where the optimized patch is not invalid, we shouldn't need to calculate the patch again.
-rw-r--r-- | jsonpatch.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jsonpatch.py b/jsonpatch.py index 0116ca2..9e9e5aa 100644 --- a/jsonpatch.py +++ b/jsonpatch.py @@ -179,7 +179,7 @@ def make_patch(src, dst): if new != dst: return JsonPatch.from_diff(src, dst, False) - return JsonPatch.from_diff(src, dst) + return patch class JsonPatch(object): |