SenseApiMgr: Print dev info when detaching, use early return pattern
This commit is contained in:
@@ -312,15 +312,17 @@ static int xcbWindow_detachDeviceReq(const smo::device::SenseDeviceSpec& spec)
|
||||
}
|
||||
);
|
||||
|
||||
if (it != g_attachedWindows.end())
|
||||
if (it == g_attachedWindows.end())
|
||||
{
|
||||
g_attachedWindows.erase(it);
|
||||
std::cout << __func__ << ": Detached X11 window device\n";
|
||||
return 0;
|
||||
std::cerr << __func__ << ": Device not found for detachment:\n"
|
||||
<< spec.stringify() << "\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::cerr << __func__ << ": Device not found for detachment\n";
|
||||
return -1;
|
||||
g_attachedWindows.erase(it);
|
||||
std::cout << __func__ << ": Detached X11 window device:\n"
|
||||
<< spec.stringify() << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SenseApi descriptor
|
||||
|
||||
Reference in New Issue
Block a user