Skip to content

Commit

Permalink
Merge branch 'fix/durations-matrix-with-location_index'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Jun 20, 2023
2 parents 9b7165e + 39155df commit 4e134e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
- Update formatting script to use `clang-format` 14 (#894)
- Setup a `clang-tidy` workflow (#789)

### Fixed

- Internal matrix problem with inconsistent `location_index` and `location` values (#909)

## [v1.13.0] - 2023-01-31

### Added
Expand Down
13 changes: 7 additions & 6 deletions src/structures/vroom/location.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ class Location {
namespace std {
template <> struct hash<vroom::Location> {
std::size_t operator()(const vroom::Location& l) const noexcept {
if (l.has_coordinates()) {
return ((hash<vroom::Coordinate>()(l.lon()) ^
(hash<vroom::Coordinate>()(l.lat()) << 1)) >>
1);
if (l.user_index()) {
return hash<vroom::Index>()(l.index());
}
assert(l.user_index());
return hash<vroom::Index>()(l.index());

assert(l.has_coordinates());
return ((hash<vroom::Coordinate>()(l.lon()) ^
(hash<vroom::Coordinate>()(l.lat()) << 1)) >>
1);
}
};
} // namespace std
Expand Down

0 comments on commit 4e134e7

Please sign in to comment.