From 684878b1fdba2346c01e04491391858b1e78780d Mon Sep 17 00:00:00 2001 From: Pitchaya Boonsarngsuk <2285135b@student.gla.ac.uk> Date: Thu, 22 Mar 2018 16:30:41 +0000 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20coding=20style=20?= =?UTF-8?q?=E0=B8=A0=E0=B8=B2=E0=B8=84=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc | 1 + src/interpolation/interpCommon.js | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.eslintrc b/.eslintrc index 73b137e..b60e867 100644 --- a/.eslintrc +++ b/.eslintrc @@ -10,6 +10,7 @@ rules: - error - always no-return-assign: 0 + one-var: 0 /* no-extra-parens: 1 curly: 0 diff --git a/src/interpolation/interpCommon.js b/src/interpolation/interpCommon.js index 30e81d9..84a0c02 100644 --- a/src/interpolation/interpCommon.js +++ b/src/interpolation/interpCommon.js @@ -38,11 +38,9 @@ export function placeNearToNearestNeighbour (node, nearNeighbour, radius, sample // Determine the closest quadrant if (dist0 == dist180) { - if (dist90 > dist270) { lowBound = highBound = 270; } - else { lowBound = highBound = 90; } + if (dist90 > dist270) { lowBound = highBound = 270; } else { lowBound = highBound = 90; } } else if (dist90 == dist270) { - if (dist0 > dist180) { lowBound = highBound = 180; } - else { lowBound = highBound = 0; } + if (dist0 > dist180) { lowBound = highBound = 180; } else { lowBound = highBound = 0; } } else if (dist0 > dist180) { if (dist90 > dist270) { lowBound = 180; @@ -120,8 +118,7 @@ function binarySearchMin (lb, hb, fn) { if (valLowerHalf > valHigherHalf) { lb = Math.floor((lb + hb) / 2); - } - else if (valLowerHalf < valHigherHalf) { + } else if (valLowerHalf < valHigherHalf) { hb = Math.ceil((lb + hb) / 2); } else { lb += Math.floor(range / 4);