แก้ coding style ภาค 6
This commit is contained in:
@@ -10,6 +10,7 @@ rules:
|
|||||||
- error
|
- error
|
||||||
- always
|
- always
|
||||||
no-return-assign: 0
|
no-return-assign: 0
|
||||||
|
one-var: 0
|
||||||
/*
|
/*
|
||||||
no-extra-parens: 1
|
no-extra-parens: 1
|
||||||
curly: 0
|
curly: 0
|
||||||
|
|||||||
@@ -38,11 +38,9 @@ export function placeNearToNearestNeighbour (node, nearNeighbour, radius, sample
|
|||||||
|
|
||||||
// Determine the closest quadrant
|
// Determine the closest quadrant
|
||||||
if (dist0 == dist180) {
|
if (dist0 == dist180) {
|
||||||
if (dist90 > dist270) { lowBound = highBound = 270; }
|
if (dist90 > dist270) { lowBound = highBound = 270; } else { lowBound = highBound = 90; }
|
||||||
else { lowBound = highBound = 90; }
|
|
||||||
} else if (dist90 == dist270) {
|
} else if (dist90 == dist270) {
|
||||||
if (dist0 > dist180) { lowBound = highBound = 180; }
|
if (dist0 > dist180) { lowBound = highBound = 180; } else { lowBound = highBound = 0; }
|
||||||
else { lowBound = highBound = 0; }
|
|
||||||
} else if (dist0 > dist180) {
|
} else if (dist0 > dist180) {
|
||||||
if (dist90 > dist270) {
|
if (dist90 > dist270) {
|
||||||
lowBound = 180;
|
lowBound = 180;
|
||||||
@@ -120,8 +118,7 @@ function binarySearchMin (lb, hb, fn) {
|
|||||||
|
|
||||||
if (valLowerHalf > valHigherHalf) {
|
if (valLowerHalf > valHigherHalf) {
|
||||||
lb = Math.floor((lb + hb) / 2);
|
lb = Math.floor((lb + hb) / 2);
|
||||||
}
|
} else if (valLowerHalf < valHigherHalf) {
|
||||||
else if (valLowerHalf < valHigherHalf) {
|
|
||||||
hb = Math.ceil((lb + hb) / 2);
|
hb = Math.ceil((lb + hb) / 2);
|
||||||
} else {
|
} else {
|
||||||
lb += Math.floor(range / 4);
|
lb += Math.floor(range / 4);
|
||||||
|
|||||||
Reference in New Issue
Block a user