perf(uORB): match nodes by ORB_ID instead of strcmp

Assisted-by: Claude:claude-fable-5-1
This commit is contained in:
Lourens Naude authored and Beat Küng committed 2026-10-22 08:26:26 +02:00
1 parent 537b82d380
commit 5abef6d065
1 file changed
+3 -1
+3 -1
View File
@@ -454,8 +454,10 @@ uORB::DeviceNode *uORB::DeviceMaster::getDeviceNode(const char *nodepath)
uORB::DeviceNode *uORB::DeviceMaster::getDeviceNodeLocked(const struct orb_metadata *meta, const uint8_t instance)
{
const ORB_ID id = static_cast<ORB_ID>(meta->o_id);
for (uORB::DeviceNode *node : _node_list) {
if ((strcmp(node->get_name(), meta->o_name) == 0) && (node->get_instance() == instance)) {
if ((node->id() == id) && (node->get_instance() == instance)) {
return node;
}
}