Skip to content

Commit 1e60d54

Browse files
committed
Sonar fixes
1 parent 30a14c9 commit 1e60d54

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/libcyphal/presentation/presentation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ class Presentation final : private detail::IPresentationDelegate
511511
///
512512
/// @param transfer_id_map The transfer ID map object to be used by the presentation layer.
513513
/// Could be reset at any moment to other value (or `nullptr` to return default mode).
514-
/// Already existing entities will automatically switch the latest state.
514+
/// Already existing entities will automatically switch to the latest state.
515515
/// While being set, it must outlive this presentation object.
516516
///
517517
void setTransferIdMap(transport::ITransferIdMap* const transfer_id_map) noexcept

include/libcyphal/transport/transfer_id_map.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class ITransferIdMap
3535
const PortId port_id;
3636
const NodeId node_id;
3737

38-
bool operator==(const SessionSpec& other) const
38+
friend bool operator==(const SessionSpec& lhs, const SessionSpec& rhs) noexcept
3939
{
40-
return port_id == other.port_id && node_id == other.node_id;
40+
return (lhs.port_id == rhs.port_id) && (lhs.node_id == rhs.node_id);
4141
}
4242

4343
}; // SessionSpec
@@ -221,7 +221,7 @@ struct std::hash<libcyphal::transport::ITransferIdMap::SessionSpec>
221221
{
222222
const std::size_t h1 = std::hash<libcyphal::transport::PortId>{}(spec.port_id);
223223
const std::size_t h2 = std::hash<libcyphal::transport::NodeId>{}(spec.node_id);
224-
return h1 ^ (h2 << 1);
224+
return h1 ^ (h2 << 1U);
225225
}
226226
};
227227

0 commit comments

Comments
 (0)