refactor: server: use contains when possible
This commit is contained in:
parent
85e7d95188
commit
db67550db3
1 changed files with 5 additions and 5 deletions
|
|
@ -800,10 +800,10 @@ bool Server::isSwitchOkay(
|
||||||
// are we in a locked corner? first check if screen has the option set
|
// are we in a locked corner? first check if screen has the option set
|
||||||
// and, if not, check the global options.
|
// and, if not, check the global options.
|
||||||
const Config::ScreenOptions *options = m_config->getOptions(getName(m_active));
|
const Config::ScreenOptions *options = m_config->getOptions(getName(m_active));
|
||||||
if (options == nullptr || options->count(kOptionScreenSwitchCorners) == 0) {
|
if (options == nullptr || !options->contains(kOptionScreenSwitchCorners)) {
|
||||||
options = m_config->getOptions("");
|
options = m_config->getOptions("");
|
||||||
}
|
}
|
||||||
if (options != nullptr && options->count(kOptionScreenSwitchCorners) > 0) {
|
if (options != nullptr && options->contains(kOptionScreenSwitchCorners)) {
|
||||||
// get corner mask and size
|
// get corner mask and size
|
||||||
Config::ScreenOptions::const_iterator i = options->find(kOptionScreenSwitchCorners);
|
Config::ScreenOptions::const_iterator i = options->find(kOptionScreenSwitchCorners);
|
||||||
auto corners = static_cast<uint32_t>(i->second);
|
auto corners = static_cast<uint32_t>(i->second);
|
||||||
|
|
@ -1129,7 +1129,7 @@ void Server::processOptions()
|
||||||
|
|
||||||
void Server::handleShapeChanged(BaseClientProxy *client)
|
void Server::handleShapeChanged(BaseClientProxy *client)
|
||||||
{
|
{
|
||||||
if (m_clientSet.count(client) == 0) {
|
if (!m_clientSet.contains(client)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1164,7 +1164,7 @@ void Server::handleClipboardGrabbed(const Event &event, BaseClientProxy *grabber
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore events from unknown clients
|
// ignore events from unknown clients
|
||||||
if (m_clientSet.count(grabber) == 0) {
|
if (!m_clientSet.contains(grabber)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto *info = static_cast<const IScreen::ClipboardInfo *>(event.getData());
|
const auto *info = static_cast<const IScreen::ClipboardInfo *>(event.getData());
|
||||||
|
|
@ -1850,7 +1850,7 @@ void Server::onMouseWheel(int32_t xDelta, int32_t yDelta)
|
||||||
bool Server::addClient(BaseClientProxy *client)
|
bool Server::addClient(BaseClientProxy *client)
|
||||||
{
|
{
|
||||||
std::string name = getName(client);
|
std::string name = getName(client);
|
||||||
if (m_clients.count(name) != 0) {
|
if (m_clients.contains(name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue