summaryrefslogtreecommitdiff
path: root/src/translation.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-03-26 12:23:51 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2024-03-26 12:23:51 +0100
commit6e461de50e73c0c957af73e5ee7a25f4d0293490 (patch)
tree03916b36c1cf0e25239b8d6cc0cf013b0fcb3697 /src/translation.cc
parent702e6907265035af031004f21ce09e3f62037fb4 (diff)
Make all mutex locks const, as per linter warning
Diffstat (limited to 'src/translation.cc')
-rw-r--r--src/translation.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/translation.cc b/src/translation.cc
index 18763e4..c71f6c0 100644
--- a/src/translation.cc
+++ b/src/translation.cc
@@ -62,13 +62,13 @@ bool comparator(const Text& a, const Text& b)
Translation::Translation()
{
- std::lock_guard<std::mutex>(singleton.mutex);
+ const std::lock_guard<std::mutex> lock(singleton.mutex);
++singleton.refcnt;
}
Translation::~Translation()
{
- std::lock_guard<std::mutex>(singleton.mutex);
+ const std::lock_guard<std::mutex> lock(singleton.mutex);
--singleton.refcnt;
@@ -219,7 +219,7 @@ bool Translation::load(const char* catalog, std::size_t size)
std::sort(texts.begin(), texts.end(), comparator);
{
- std::lock_guard<std::mutex>(singleton.mutex);
+ const std::lock_guard<std::mutex> lock(singleton.mutex);
std::swap(singleton.texts, texts);
}
@@ -228,7 +228,7 @@ bool Translation::load(const char* catalog, std::size_t size)
const char* Translation::gettext(std::uint64_t msgid, const char* original)
{
- std::lock_guard<std::mutex>(singleton.mutex);
+ const std::lock_guard<std::mutex> lock(singleton.mutex);
if(singleton.refcnt == 0)
{
return original;