Prevent from being paired with yourself

This commit is contained in:
Maël Nison 2016-12-05 23:05:54 +01:00 committed by GitHub
parent 10e888a4cc
commit 5f90fc5562

View file

@ -38,7 +38,7 @@ SecretSanta.prototype.generate = function () {
this.names.forEach( function ( name ) {
var candidates = _.difference( this.names, name );
var candidates = _.difference( this.names, [ name ] );
if ( Object.prototype.hasOwnProperty.call( this.blacklists, name ) )
candidates = _.difference( candidates, this.blacklists[ name ] );