commit 7c219316e8a34e406108b7eeb5ba098a792c4312
parent ef981559f89ef9cca302a0ea2c01a70e1f88fa78
Author: sin <sin@2f30.org>
Date: Thu, 4 Jun 2015 15:27:12 +0100
Minor comments fix
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/colors.c b/colors.c
@@ -136,7 +136,7 @@ process(void)
for (i = 0; i < nclusters; i++)
dists[i] = distance(p, &clusters[i].c);
- /* find the cluster that is closest to the point */
+ /* find the cluster that is nearest to the point */
mind = dists[0];
mini = 0;
for (i = 1; i < nclusters; i++) {
@@ -146,10 +146,11 @@ process(void)
}
}
- /* if point is already part of the closest cluster, skip it */
+ /* if point is already part of the nearest cluster, skip it */
if (hasmember(&clusters[mini], p))
continue;
+ /* not done yet, move point to nearest cluster */
done = 0;
for (i = 0; i < nclusters; i++) {
if (hasmember(&clusters[i], p)) {