diff --git a/src/libplatform/default-platform.cc b/src/libplatform/default-platform.cc index 3c29bd7eaa..c23616116e 100644 --- a/src/libplatform/default-platform.cc +++ b/src/libplatform/default-platform.cc @@ -140,11 +140,9 @@ bool DefaultPlatform::PumpMessageLoop(v8::Isolate* isolate, std::shared_ptr task_runner; { base::LockGuard guard(&lock_); - if (foreground_task_runner_map_.find(isolate) == - foreground_task_runner_map_.end()) { - return failed_result; - } - task_runner = foreground_task_runner_map_[isolate]; + auto it = foreground_task_runner_map_.find(isolate); + if (it == foreground_task_runner_map_.end()) return failed_result; + task_runner = it->second; } std::unique_ptr task = task_runner->PopTaskFromQueue(wait_for_work);