Permalink
Browse files

Fixed incorrect comment

  • Loading branch information...
1 parent 4133741 commit 493521ef6cafb6131bb8d5e0bebd5371086713b6 @nathanl committed Nov 26, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 secret_santa.rb
View
9 secret_santa.rb
@@ -30,9 +30,12 @@
end
# This is the nice part of Dennis's solution: if there are any invalid
-# assignments, they are corrected in a single pass. This is possible because
-# corrections are made in a way that ensures no new invalid assignments are
-# created.
+# assignments, they are corrected in as few passes as possible. (I
+# originally said "a single pass", but that's not true because the
+# `select` that looks for someone to swap santas with is just a
+# way of saying "loop through the list of people looking for a match.")
+# This works because corrections are made in a way that ensures no new
+# invalid assignments are created.
Logger.log "Checking assignments for validity"
people.each do |person|
unless person.santa.can_be_santa_of?(person)

0 comments on commit 493521e

Please sign in to comment.