day19: cosmetic changes
This commit is contained in:
@@ -65,7 +65,7 @@ ex2: aoc-c
|
|||||||
@$(TIME) aoc-c -p 2 < $(INPUT)
|
@$(TIME) aoc-c -p 2 < $(INPUT)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f aoc-c core* gmon.out
|
@rm -f aoc-c core* vgcore* gmon.out aoc-c.s
|
||||||
|
|
||||||
.c:
|
.c:
|
||||||
@echo compiling $<
|
@echo compiling $<
|
||||||
|
@@ -371,8 +371,8 @@ static int count_common_distances(scanner_t *s1, scanner_t *s2)
|
|||||||
/* we need to adjust references for the two pairs of
|
/* we need to adjust references for the two pairs of
|
||||||
* 2 beacons having same distance, for both scanners.
|
* 2 beacons having same distance, for both scanners.
|
||||||
*/
|
*/
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int sc = 0; sc < 2; sc++) {
|
||||||
if (i == 0) {
|
if (sc == 0) {
|
||||||
beacon1 = pdist1->beacon1;
|
beacon1 = pdist1->beacon1;
|
||||||
beacon2 = pdist1->beacon2;
|
beacon2 = pdist1->beacon2;
|
||||||
scanner = s1;
|
scanner = s1;
|
||||||
@@ -416,17 +416,13 @@ static int count_common_distances(scanner_t *s1, scanner_t *s2)
|
|||||||
nref++;
|
nref++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else if (dist1 < dist2) {
|
} else if (dist1 < dist2) {
|
||||||
plist1 = plist1->next;
|
plist1 = plist1->next;
|
||||||
} else { /* dist1 > dist2 */
|
} else { /* dist1 > dist2 */
|
||||||
plist2 = plist2->next;
|
plist2 = plist2->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user