Skip to content

Commit

Permalink
adjusted uniqueness check
Browse files Browse the repository at this point in the history
  • Loading branch information
FedorSmirnov89 committed Feb 14, 2018
1 parent d13ef86 commit c5e6bdb
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ public class IntegerMapGenotype<K> extends IntegerGenotype implements MapGenotyp
*/
public IntegerMapGenotype(List<K> list, Bounds<Integer> bounds) {
super(bounds);
Set<K> uniqueKeys = new HashSet<K>();
for (K k : list) {
uniqueKeys.add(k);
}
Set<K> uniqueKeys = new HashSet<K>(list);
if (uniqueKeys.size() < list.size()) {
throw new IllegalArgumentException("The provided key objects have to be unique");
}
Expand Down

0 comments on commit c5e6bdb

Please sign in to comment.