Do not compare items with themselves when searching for duplicates with different IDs.