mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 08:39:19 +02:00
refactor(sonar): use std::scoped_lock instead of std::lock_guard (cpp:S5997)
This commit is contained in:
@@ -174,7 +174,7 @@ void WriteLog(std::string_view str, logtype type, bool isError)
|
||||
|
||||
const auto message = FormatLogMessage(str);
|
||||
|
||||
std::lock_guard<std::mutex> lock(logMutex);
|
||||
std::scoped_lock lock(logMutex);
|
||||
InfoStack.push_back({message, isError});
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ void ErrorLog(std::string_view str, logtype type)
|
||||
|
||||
const auto message = FormatLogMessage(str);
|
||||
|
||||
std::lock_guard<std::mutex> lock(logMutex);
|
||||
std::scoped_lock lock(logMutex);
|
||||
ErrorStack.push_back(message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user