[gnome-shell] hwtest.js: Fix median computation



commit 28cc0da151ede6f275d9e67810dc6a45e5498c33
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sun Aug 10 09:23:48 2014 +0200

    hwtest.js: Fix median computation
    
    By default Array.prototype.sort() sorts all values by converting
    them to strings, even numbers!

 js/perf/hwtest.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/js/perf/hwtest.js b/js/perf/hwtest.js
index fbadde4..9cc0db8 100644
--- a/js/perf/hwtest.js
+++ b/js/perf/hwtest.js
@@ -270,7 +270,7 @@ function script_redrawTestDone(time) {
 function script_collectTimings(time) {
     for (let timing in redrawTimes) {
         let times = redrawTimes[timing];
-        times.sort();
+        times.sort(function(a, b) { return a - b });
 
         let len = times.length;
         let median;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]