From e8fbd18d933f5d395576255208843808a875fd54 Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Sun, 9 Jul 2017 17:37:42 +0200 Subject: Avoid double work (#62) In the case where the optimized patch is not invalid, we shouldn't need to calculate the patch again. --- jsonpatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): -- cgit v1.2.1