faster keys comparison

This commit is contained in:
Luke Campagnola 2018-08-06 09:17:23 -07:00 committed by Ogi Moore
parent 7cb27594a5
commit a8529e48f3

View File

@ -446,7 +446,7 @@ def eq(a, b):
if isinstance(a, dict) and isinstance(b, dict):
if type(a) != type(b) or len(a) != len(b):
return False
if set(a.keys()) != set(b.keys()):
if sorted(a.keys()) != sorted(b.keys()):
return False
for k,v in a.items():
if not eq(v, b[k]):