Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix operator overload on RouteParameters #6646

Merged
merged 4 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- NodeJS:
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
- Misc:
- FIXED: Fix an error in a RouteParameters AnnotationsType operator overload. [#6646](https://github.com/Project-OSRM/osrm-backend/pull/6646)
- ADDED: Add support for "unlimited" to be passed as a value for the default-radius and max-matching-radius flags. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
- CHANGED: Allow -1.0 as unlimited for default_radius value. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
- CHANGED: keep libosrm* in the docker image for downstream linking [#6602](https://github.com/Project-OSRM/osrm-backend/pull/6602)
Expand Down
4 changes: 2 additions & 2 deletions include/engine/api/route_parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ inline RouteParameters::AnnotationsType operator|(RouteParameters::AnnotationsTy
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
}

inline RouteParameters::AnnotationsType operator|=(RouteParameters::AnnotationsType lhs,
RouteParameters::AnnotationsType rhs)
inline RouteParameters::AnnotationsType &operator|=(RouteParameters::AnnotationsType &lhs,
RouteParameters::AnnotationsType rhs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth deleting this function instead. I assume given the bug that it's not in use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can commit a change to remove it instead if it's preferred, but I think that given the use of the | operator, it might be more helpful to keep around fixed, since it can help when calculating the AnnotationsType (ie. able to do lhs |= rhs rather than lhs = lhs | rhs).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks for spotting 👍

{
return lhs = lhs | rhs;
}
Expand Down