mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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…
x
Reference in New Issue
Block a user