fix: address PR reviewer feedback regarding random_shuffle and queue.empty()

This commit is contained in:
zukrmn
2026-03-07 04:57:43 +00:00
committed by JuiceyDev
parent 42b0352ec3
commit c122bff122
2 changed files with 3 additions and 4 deletions

View File

@@ -344,7 +344,7 @@ void Socket::SocketInputStreamLocal::close()
{
m_streamOpen = false;
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
while(!s_hostQueue[m_queueIdx].empty()) s_hostQueue[m_queueIdx].pop();
std::queue<uint8_t>().swap(s_hostQueue[m_queueIdx]);
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
}
@@ -392,7 +392,7 @@ void Socket::SocketOutputStreamLocal::close()
{
m_streamOpen = false;
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
while(!s_hostQueue[m_queueIdx].empty()) s_hostQueue[m_queueIdx].pop();
std::queue<uint8_t>().swap(s_hostQueue[m_queueIdx]);
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
}