From 077075be03eab601e207306d885bc76f648f48a9 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 7 Sep 2016 19:07:59 +0100 Subject: [PATCH] More optimised way to sort in reverse --- src/app.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app.js b/src/app.js index 2c8c40d933..2e09d2b067 100644 --- a/src/app.js +++ b/src/app.js @@ -529,10 +529,9 @@ var run = function () { // Sort builds according to semver var builds = data.builds.sort(function (a, b) { - a = buildVersion(a); - b = buildVersion(b); - return semver.compare(a, b); - }).reverse(); + // NOTE: b vs. a (the order is important), because we want latest first in the list + return semver.compare(buildVersion(b), buildVersion(a)); + }); // populate version dropdown with all available compiler versions $.each(builds, function (i, build) {