summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Seligmann <mithrandi@mithrandi.net>2017-07-09 17:37:42 +0200
committerStefan Kögl <stefan@skoegl.net>2017-07-09 17:37:42 +0200
commite8fbd18d933f5d395576255208843808a875fd54 (patch)
treebb279b7642643a83664a07ef32abf8943854a03c
parent18887df8af5f761aa83c76a7cd3777210b2527ad (diff)
downloadpython-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.py2
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):