find_beads 0.9.2-java → 0.9.3-java
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/find_beads/version.rb +1 -1
- data/lib/find_beads.rb +7 -1
- metadata +1 -1
data/lib/find_beads/version.rb
CHANGED
data/lib/find_beads.rb
CHANGED
@@ -124,11 +124,17 @@ module FindBeads
|
|
124
124
|
|
125
125
|
closest_index = i
|
126
126
|
|
127
|
+
elsif dist < next_dist then
|
128
|
+
|
129
|
+
next_dist = dist
|
130
|
+
|
131
|
+
next_index = i
|
132
|
+
|
127
133
|
end
|
128
134
|
|
129
135
|
end
|
130
136
|
|
131
|
-
cutoff =
|
137
|
+
cutoff = 1.01*Math.sqrt(2)
|
132
138
|
|
133
139
|
if next_dist - closest_dist < cutoff then
|
134
140
|
|