optimized IncomingMessageDispatcher::HandleMessage a bit (flutter/engine#34954)
* optimized IncomingMessageDispatcher::HandleMessage a bit. * removed std::string ref
This commit is contained in:
@@ -19,14 +19,15 @@ void IncomingMessageDispatcher::HandleMessage(
|
||||
const std::function<void(void)>& input_unblock_cb) {
|
||||
std::string channel(message.channel);
|
||||
|
||||
auto callback_iterator = callbacks_.find(channel);
|
||||
// Find the handler for the channel; if there isn't one, report the failure.
|
||||
if (callbacks_.find(channel) == callbacks_.end()) {
|
||||
if (callback_iterator == callbacks_.end()) {
|
||||
FlutterDesktopMessengerSendResponse(messenger_, message.response_handle,
|
||||
nullptr, 0);
|
||||
return;
|
||||
}
|
||||
auto& callback_info = callbacks_[channel];
|
||||
FlutterDesktopMessageCallback message_callback = callback_info.first;
|
||||
auto& callback_info = callback_iterator->second;
|
||||
const FlutterDesktopMessageCallback& message_callback = callback_info.first;
|
||||
|
||||
// Process the call, handling input blocking if requested.
|
||||
bool block_input = input_blocking_channels_.count(channel) > 0;
|
||||
|
||||
Reference in New Issue
Block a user