Skip to content

Commit

Permalink
Minor improvement to day 18 (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardGomezEscandell authored Dec 19, 2023
2 parents 94b782f + c87fa34 commit f59790a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 101 deletions.
2 changes: 1 addition & 1 deletion 2023/solvelib/18/day18.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ struct canvas {
};

block_t len_to_block(length_t p, std::vector<length_t> const& mapping) {
auto it = std::find_if(mapping.begin(), mapping.end(), xmas::equals(p));
auto it = std::partition_point(mapping.begin(), mapping.end(), xmas::less_than(p));
if (it == mapping.end()) {
throw std::runtime_error(std::format("Coordinate past end of the range"));
}
Expand Down
100 changes: 0 additions & 100 deletions 2023/xmaslib/algorithm/find.hpp

This file was deleted.

0 comments on commit f59790a

Please sign in to comment.