Appease the gods of const

This commit is contained in:
David Thomas 2025-06-21 18:25:05 +01:00
parent 4e5ae492e5
commit 2ba52d6d6c
No known key found for this signature in database
GPG Key ID: 553E822E460EE293
2 changed files with 4 additions and 4 deletions

View File

@ -35,13 +35,13 @@ bool DitheringAlgorithmIsDiffusion(DitheringAlgorithm algo)
} }
} }
const std::string DitheringAlgorithmToString(DitheringAlgorithm algo) std::string DitheringAlgorithmToString(DitheringAlgorithm algo)
{ {
auto it = names.find(algo); auto it = names.find(algo);
return (it != names.end()) ? it->second : "unknown"; return (it != names.end()) ? it->second : "unknown";
} }
const DitheringAlgorithm DitheringAlgorithmFromString(std::string name) const DitheringAlgorithm DitheringAlgorithmFromString(const std::string name)
{ {
auto it = std::find_if(names.begin(), names.end(), [name](const auto& pair) { auto it = std::find_if(names.begin(), names.end(), [name](const auto& pair) {
return base::utf8_icmp(pair.second, name) == 0; return base::utf8_icmp(pair.second, name) == 0;

View File

@ -28,8 +28,8 @@ enum class DitheringAlgorithm {
}; };
bool DitheringAlgorithmIsDiffusion(DitheringAlgorithm algo); bool DitheringAlgorithmIsDiffusion(DitheringAlgorithm algo);
const std::string DitheringAlgorithmToString(DitheringAlgorithm algo); std::string DitheringAlgorithmToString(DitheringAlgorithm algo);
const DitheringAlgorithm DitheringAlgorithmFromString(std::string name); const DitheringAlgorithm DitheringAlgorithmFromString(const std::string name);
} // namespace render } // namespace render