forked from Archive/PX4-Autopilot
uORB::DeviceMaster::ioctl: avoid operator[], since we already have the iterator
In the existing implementation, the map had to be searched twice.
This commit is contained in:
parent
9c360e9f88
commit
e9019582cc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue