           continue  unless @hasUserId(@newPlayers[i].player.id)
           @newPlayers[i].rating = rating
 
-        @newPlayers = []  # reset the new players list, we're done
+        # reset the new players list, we're done
+        @newPlayers.splice(0, @newPlayers.length)  
         next(null)
 
   # Returns an array of pairs. Each pair is a queue object that contains

ratings = require('./ratings')
alts = require('./alts')

class QueuedPlayer
  constructor: (player) ->
    @player = player
    @range = 100
    @rating = null  # needs to be updated by getRatings

  intersectsWith: (other) ->


  hasRecentlyMatched: (player1Id, player2Id) ->
    players = [player1Id, player2Id].sort()
    key = "#{players[0]}:#{players[1]}"
    @recentlyMatched[key]?

  addRecentMatch: (player1Id, player2Id) ->
    players = [player1Id, player2Id].sort()
    key = "#{players[0]}:#{players[1]}"
    @recentlyMatched[key] = true
    setTimeout((=> delete @recentlyMatched[key]), 30 * 60 * 1000) # expire in 30 minutes

