From c6a90a623357efe85f28eca681eb0b7bf21520b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Fri, 12 Jul 2013 16:16:15 +0200 Subject: simplify equality comparison --- jsonpatch.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'jsonpatch.py') diff --git a/jsonpatch.py b/jsonpatch.py index 5d74f48..59b9016 100644 --- a/jsonpatch.py +++ b/jsonpatch.py @@ -203,10 +203,8 @@ class JsonPatch(object): if not isinstance(other, JsonPatch): return False - if len(self._ops) != len(other._ops): - return False - - return all(map(operator.eq, self._ops, other._ops)) + return len(self._ops) == len(other._ops) and \ + all(map(operator.eq, self._ops, other._ops)) @classmethod -- cgit v1.2.1