mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Reduce allocations.
This commit is contained in:
@@ -38,9 +38,11 @@ namespace {
|
||||
std::pair<std::size_t, std::size_t> part1(const std::vector<point_t> &points) {
|
||||
std::size_t best = 0;
|
||||
std::size_t best_index = 0;
|
||||
std::unordered_set<point_t> visible;
|
||||
|
||||
for (std::size_t i = 0; i < points.size(); ++i) {
|
||||
std::unordered_set<point_t> visible;
|
||||
visible.clear();
|
||||
|
||||
const auto point = points[i];
|
||||
|
||||
for (auto asteroid : points) {
|
||||
|
||||
Reference in New Issue
Block a user