From c9286d467fad69be18f270cdc188b2ee5f56ff32 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 14:18:48 +0000 Subject: [PATCH] Decompile 2 functions in Source/Utility/Async/NAsyncWorkQueue.cpp Batch #15994 by Yommy: 0 byte-identical, 2 confirmed by peer review. - fn_07569 NAsyncWorkRequestQueue::Pop: logic confirmed by peer review - fn_07574 NAsyncWorkResponseQueue::Pop: logic confirmed by peer review Peer-reviewed-by: alisonrag, youko Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Utility/Async/NAsyncWorkQueue.cpp | 38 +++++++++++++----------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Source/Utility/Async/NAsyncWorkQueue.cpp b/Source/Utility/Async/NAsyncWorkQueue.cpp index 2c9a87962..5df148cf4 100644 --- a/Source/Utility/Async/NAsyncWorkQueue.cpp +++ b/Source/Utility/Async/NAsyncWorkQueue.cpp @@ -27,25 +27,26 @@ NAsyncWorkRequestQueue::~NAsyncWorkRequestQueue() { // FUNCTION: fn_07569 NAsyncWorkPtr NAsyncWorkRequestQueue::Pop() { NSyncObject held(&this->m_criticalSection); - if (!this->m_pending.empty()) { - unsigned examined = 1; + if (this->m_pending.empty()) { + return NAsyncWorkPtr(nullptr, ""); + } - for (auto work = this->m_pending.begin(); work != this->m_pending.end(); ++work) { - if (examined > 40) { - break; - } - - auto key = work->Get()->GroupKey(); - if (std::find(this->m_active.begin(), this->m_active.end(), key) == this->m_active.end()) { - this->m_active.push_back(key); - NAsyncWorkPtr result(*work); - this->m_pending.erase(work); - - return result; - } - - ++examined; + unsigned examined = 1; + for (auto work = this->m_pending.begin(); work != this->m_pending.end(); ++work) { + if (examined > 40) { + break; } + + auto key = work->Get()->GroupKey(); + if (std::find(this->m_active.begin(), this->m_active.end(), key) == this->m_active.end()) { + this->m_active.push_back(key); + NAsyncWorkPtr result(*work); + this->m_pending.erase(work); + + return result; + } + + ++examined; } ++this->m_waiting; @@ -110,7 +111,8 @@ void NAsyncWorkResponseQueue::Push(NAsyncWorkPtr& work) { NAsyncWorkResponse NAsyncWorkResponseQueue::Pop() { NSyncObject held(&this->m_criticalSection); if (this->m_pending.empty()) { - return {false, NAsyncWorkPtr(nullptr, "")}; + NAsyncWorkPtr empty(nullptr, ""); + return {false, empty}; } NAsyncWorkPtr work(this->m_pending.front());