From 6e461de50e73c0c957af73e5ee7a25f4d0293490 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 26 Mar 2024 12:23:51 +0100 Subject: Make all mutex locks const, as per linter warning --- src/translation.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/translation.cc') 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(singleton.mutex); + const std::lock_guard lock(singleton.mutex); ++singleton.refcnt; } Translation::~Translation() { - std::lock_guard(singleton.mutex); + const std::lock_guard 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(singleton.mutex); + const std::lock_guard 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(singleton.mutex); + const std::lock_guard lock(singleton.mutex); if(singleton.refcnt == 0) { return original; -- cgit v1.2.3