day19: cosmetic changes

This commit is contained in:
2022-01-22 20:18:15 +01:00
parent 5346b0e7fa
commit 2692f3f621
2 changed files with 3 additions and 7 deletions

View File

@@ -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 $<

View File

@@ -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;
} }