mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-21 00:19:29 +02:00
Fix miscellaneous issues discovered by Sonar
This commit is contained in:
@ -136,7 +136,7 @@ void NetworkConnection::setAsyncWritesEnabled(bool on)
|
||||
|
||||
void NetworkConnection::sendPacket(const std::vector<std::byte> & message)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(writeMutex);
|
||||
std::lock_guard lock(writeMutex);
|
||||
std::vector<std::byte> headerVector(sizeof(uint32_t));
|
||||
uint32_t messageSize = message.size();
|
||||
std::memcpy(headerVector.data(), &messageSize, sizeof(uint32_t));
|
||||
@ -177,7 +177,7 @@ void NetworkConnection::doSendData()
|
||||
|
||||
void NetworkConnection::onDataSent(const boost::system::error_code & ec)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(writeMutex);
|
||||
std::lock_guard lock(writeMutex);
|
||||
dataToSend.pop_front();
|
||||
if (ec)
|
||||
{
|
||||
|
Reference in New Issue
Block a user