Skip to content

Commit

Permalink
Ensure all items of array are checked for uniqueness
Browse files Browse the repository at this point in the history
Fix bug where the function would return (True) early if the first two items of
the array are unique, preventing verification of other array items.
  • Loading branch information
DrGFreeman committed Nov 4, 2021
1 parent 64622fd commit 1085b27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jsonschema/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def uniq(container):
sliced = itertools.islice(sort, 1, None)

for i, j in zip(sort, sliced):
return not _sequence_equal(i, j)
if _sequence_equal(i, j):
return False

except (NotImplementedError, TypeError):
seen = []
Expand Down

0 comments on commit 1085b27

Please sign in to comment.