From 92865f1219ed916dd82e1a96c5496bc3f9ca804a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Ribeiro?= Date: Sat, 11 Oct 2014 22:03:50 -0300 Subject: [PATCH] upload_handler: fix slot search --- src/upload_handler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/upload_handler.js b/src/upload_handler.js index 330d129..3c376e6 100644 --- a/src/upload_handler.js +++ b/src/upload_handler.js @@ -3,10 +3,10 @@ // Use of this source code is governed by a Apache // license that can be found in the LICENSE file. -var BaseObject = require('base_object'); +var BaseObject = require('base_object') var Settings = require("./settings") var _ = require("underscore") -var log = require('./log'); +var log = require('./log') class UploadHandler extends BaseObject { constructor() { @@ -16,7 +16,7 @@ class UploadHandler extends BaseObject { } getSlot(peerId) { - if (_.contains(this.slots.keys, peerId) || this.hasFreeSlots()) { + if (_.contains(_.keys(this.slots), peerId) || this.hasFreeSlots()) { this.slots[peerId] = Date.now() this.updateSlotsCount() return true