From 1faa631f890af1f19c7f8a0cdedcc04294091a44 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 22 Jan 2016 11:55:01 -0400 Subject: [PATCH] Use Bluebird's filter to simplify listRemovable() --- lib/src/drives.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/src/drives.js b/lib/src/drives.js index ae9b651d..4ee8f8b8 100644 --- a/lib/src/drives.js +++ b/lib/src/drives.js @@ -35,9 +35,7 @@ const drivelist = Bluebird.promisifyAll(require('drivelist')); * }); */ exports.listRemovable = function() { - return drivelist.listAsync().then(function(drives) { - return drives.filter(function(drive) { - return !drive.system; - }); + return drivelist.listAsync().filter(function(drive) { + return !drive.system; }); };