summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorKamikadze <40305144+Kam1k4dze@users.noreply.github.com>2025-05-30 18:25:59 +0500
committerGitHub <noreply@github.com>2025-05-30 14:25:59 +0100
commit9190443d951c21ab24201d033accf90b4d172f46 (patch)
tree28a5e4a1fa9c7424733ac7065a71cead7e141b6f /src/config/ConfigManager.cpp
parent9bf1b491440eac6f9c0d6853013ad5666c12d1d9 (diff)
refactor: use std::ranges whenever possible (#10584)
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index acbc0262..3ab53a3c 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -1651,7 +1651,7 @@ Hyprlang::CConfigValue* CConfigManager::getHyprlangConfigValuePtr(const std::str
bool CConfigManager::deviceConfigExists(const std::string& dev) {
auto copy = dev;
- std::replace(copy.begin(), copy.end(), ' ', '-');
+ std::ranges::replace(copy, ' ', '-');
return m_config->specialCategoryExistsForKey("device", copy.c_str());
}
@@ -1902,7 +1902,7 @@ static bool parseModeLine(const std::string& modeline, drmModeModeInfo& mode) {
auto args = CVarList(modeline, 0, 's');
auto keyword = args[0];
- std::transform(keyword.begin(), keyword.end(), keyword.begin(), ::tolower);
+ std::ranges::transform(keyword, keyword.begin(), ::tolower);
if (keyword != "modeline")
return false;
@@ -1938,7 +1938,7 @@ static bool parseModeLine(const std::string& modeline, drmModeModeInfo& mode) {
for (; argno < static_cast<int>(args.size()); argno++) {
auto key = args[argno];
- std::transform(key.begin(), key.end(), key.begin(), ::tolower);
+ std::ranges::transform(key, key.begin(), ::tolower);
auto it = flagsmap.find(key);
@@ -2375,7 +2375,7 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
HANDLER = "mouse";
// to lower
- std::transform(HANDLER.begin(), HANDLER.end(), HANDLER.begin(), ::tolower);
+ std::ranges::transform(HANDLER, HANDLER.begin(), ::tolower);
const auto DISPATCHER = g_pKeybindManager->m_dispatchers.find(HANDLER);
@@ -2798,7 +2798,7 @@ std::optional<std::string> CConfigManager::handleWorkspaceRules(const std::strin
wsRule.workspaceId = id;
wsRule.workspaceName = name;
- const auto IT = std::find_if(m_workspaceRules.begin(), m_workspaceRules.end(), [&](const auto& other) { return other.workspaceString == wsRule.workspaceString; });
+ const auto IT = std::ranges::find_if(m_workspaceRules, [&](const auto& other) { return other.workspaceString == wsRule.workspaceString; });
if (IT == m_workspaceRules.end())
m_workspaceRules.emplace_back(wsRule);
@@ -2896,7 +2896,7 @@ std::optional<std::string> CConfigManager::handleEnv(const std::string& command,
}
std::optional<std::string> CConfigManager::handlePlugin(const std::string& command, const std::string& path) {
- if (std::find(m_declaredPlugins.begin(), m_declaredPlugins.end(), path) != m_declaredPlugins.end())
+ if (std::ranges::find(m_declaredPlugins, path) != m_declaredPlugins.end())
return "plugin '" + path + "' declared twice";
m_declaredPlugins.push_back(path);