Skip to content
Snippets Groups Projects
Commit e9019582 authored by Beat Küng's avatar Beat Küng Committed by tumbili
Browse files

uORB::DeviceMaster::ioctl: avoid operator[], since we already have the iterator

In the existing implementation, the map had to be searched twice.
parent 9c360e9f
No related branches found
No related tags found
No related merge requests found
......@@ -688,8 +688,9 @@ uORB::DeviceNode *uORB::DeviceMaster::GetDeviceNode(const char *nodepath)
uORB::DeviceNode *rc = nullptr;
std::string np(nodepath);
if (_node_map.find(np) != _node_map.end()) {
rc = _node_map[np];
auto iter = _node_map.find(np);
if (iter != _node_map.end()) {
rc = iter->second;
}
return rc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment