mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	Use boost remove_erase_if instead of the erase-remove idiom
This commit is contained in:
		
							parent
							
								
									1f286b72a1
								
							
						
					
					
						commit
						7cde5b83bc
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -3,6 +3,7 @@ | ||||||
| // Refer to the license.txt file included.
 | // Refer to the license.txt file included.
 | ||||||
| 
 | 
 | ||||||
| #include <algorithm> | #include <algorithm> | ||||||
|  | #include <boost/range/algorithm_ext/erase.hpp> | ||||||
| #include "common/assert.h" | #include "common/assert.h" | ||||||
| #include "common/logging/log.h" | #include "common/logging/log.h" | ||||||
| #include "core/hle/config_mem.h" | #include "core/hle/config_mem.h" | ||||||
|  | @ -33,9 +34,9 @@ void WaitObject::RemoveWaitingThread(Thread* thread) { | ||||||
| 
 | 
 | ||||||
| SharedPtr<Thread> WaitObject::GetHighestPriorityReadyThread() { | SharedPtr<Thread> WaitObject::GetHighestPriorityReadyThread() { | ||||||
|     // Remove the threads that are ready or already running from our waitlist
 |     // Remove the threads that are ready or already running from our waitlist
 | ||||||
|     waiting_threads.erase(std::remove_if(waiting_threads.begin(), waiting_threads.end(), [](const SharedPtr<Thread>& thread) -> bool { |     boost::range::remove_erase_if(waiting_threads, [](const SharedPtr<Thread>& thread) -> bool { | ||||||
|         return thread->status == THREADSTATUS_RUNNING || thread->status == THREADSTATUS_READY; |         return thread->status == THREADSTATUS_RUNNING || thread->status == THREADSTATUS_READY; | ||||||
|     }), waiting_threads.end()); |     }); | ||||||
| 
 | 
 | ||||||
|     if (waiting_threads.empty()) |     if (waiting_threads.empty()) | ||||||
|         return nullptr; |         return nullptr; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue