From cd5ce20e5e334cd4df15a6f4eac3df3a23887ae1 Mon Sep 17 00:00:00 2001 From: Gabriel Devillers Date: Tue, 21 Jun 2016 14:08:27 +0200 Subject: [PATCH] Remove code duplication. Use already defined compareOn function. --- app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app.js b/app.js index 5a742a969..88ebd32b8 100755 --- a/app.js +++ b/app.js @@ -297,9 +297,7 @@ function findCompilers() { compilers = compilers.filter(function (x) { return x !== null; }); - compilers = compilers.sort(function (x, y) { - return x.name < y.name ? -1 : x.name > y.name ? 1 : 0; - }); + compilers = compilers.sort(compareOn("name")); console.log("Compilers:"); compilers.forEach(function (c) { console.log(c.id + " : " + c.name + " : " + (c.exe || c.remote));