mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	udp/client: Take std::function by const reference with TestCommunication()
Avoids redundant copies. Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									6f45b402e7
								
							
						
					
					
						commit
						c37dc23481
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		|  | @ -210,8 +210,8 @@ void Client::StartCommunication(const std::string& host, u16 port, u8 pad_index, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void TestCommunication(const std::string& host, u16 port, u8 pad_index, u32 client_id, | void TestCommunication(const std::string& host, u16 port, u8 pad_index, u32 client_id, | ||||||
|                        std::function<void()> success_callback, |                        const std::function<void()>& success_callback, | ||||||
|                        std::function<void()> failure_callback) { |                        const std::function<void()>& failure_callback) { | ||||||
|     std::thread([=] { |     std::thread([=] { | ||||||
|         Common::Event success_event; |         Common::Event success_event; | ||||||
|         SocketCallback callback{[](Response::Version version) {}, [](Response::PortInfo info) {}, |         SocketCallback callback{[](Response::Version version) {}, [](Response::PortInfo info) {}, | ||||||
|  |  | ||||||
|  | @ -89,7 +89,7 @@ private: | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| void TestCommunication(const std::string& host, u16 port, u8 pad_index, u32 client_id, | void TestCommunication(const std::string& host, u16 port, u8 pad_index, u32 client_id, | ||||||
|                        std::function<void()> success_callback, |                        const std::function<void()>& success_callback, | ||||||
|                        std::function<void()> failure_callback); |                        const std::function<void()>& failure_callback); | ||||||
| 
 | 
 | ||||||
| } // namespace InputCommon::CemuhookUDP
 | } // namespace InputCommon::CemuhookUDP
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue