From 00317ae0fd34acd2244d1ef26ef37b1f55486f59 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Fri, 27 May 2016 21:56:11 +0200 Subject: front: Some minor CPU optimizations Knocking stuff off the top of the cpu hogs from a tiny bit of profiling. --- web/js/nms-map-handlers.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'web/js/nms-map-handlers.js') diff --git a/web/js/nms-map-handlers.js b/web/js/nms-map-handlers.js index 21f2bb2..9a06b42 100644 --- a/web/js/nms-map-handlers.js +++ b/web/js/nms-map-handlers.js @@ -596,14 +596,14 @@ function comboInfo(sw) { var worst = new handlerInfo("combo", "Combo"); worst.score = -1; for (var h in handlers) { - try { - if (handlers[h].tag== "combo") - continue; - var ret = handlers[h].getInfo(sw); - if (ret.score > worst.score) { - worst = ret; - } - } catch(e) { } + if (handlers[h].tag== "combo") + continue; + if (handlers[h].getInfo == undefined) + continue; + var ret = handlers[h].getInfo(sw); + if (ret.score > worst.score) { + worst = ret; + } } worst.data = [{ description: "Worst: " + worst.description, -- cgit v1.2.3