message: Minor code cleanup in virtual_scheduler.
diff: @@ -653,7 +653,10 @@ NodeState& VirtualScheduler::GetNodeStateOrCreateIt(const NodeDef* node) {
  CHECK(!initialized_) << "GetNodeStateOrCreateIt is called after Init().";
  auto it = node_map_.find(node);
  - if (it == node_map_.end()) {
  + if (it != node_map_.end()) {
  + return it->second;
  + }
  +
  // Not found; create a NodeState for this node.
  it = node_map_.emplace(node, NodeState()).first;
  auto& node_state = it->second;
  @@ -685,7 +688,7 @@ NodeState& VirtualScheduler::GetNodeStateOrCreateIt(const NodeDef* node) {
  node_state.time_no_references[-1] = Costs::Duration::max();
  node_state.num_outputs_executed[-1] = 0;
  node_state.outputs[-1] = {};
  - }
  +
  return it->second;
  }
  @@ -903,7 +906,7 @@ Costs VirtualScheduler::Summary() const {
  << ", at the end: "
  << strings::HumanReadableNumBytes(state.memory_usage);
  - VLOG(1) << "Per-op execution time compute time / memory time "
  + VLOG(1) << "Per-op execution time / compute time / memory time "
  "(and memory usage at peak memory usage):";
  // Profile non-persistent op memory usage.
  @@ -981,7 +984,11 @@ Costs VirtualScheduler::Summary() const {
  }
  Costs VirtualScheduler::Summary(RunMetadata* metadata) {
  - if (metadata != nullptr) {
  + if (!metadata) {
  + return Summary();
  + }
  +
  + // Fill RunMetadata.
  StepStats* stepstats = metadata->mutable_step_stats();
  for (const auto& device : device_) {
  GraphDef* device_partition_graph = metadata->add_partition_graphs();
  @@ -1029,7 +1036,7 @@ Costs VirtualScheduler::Summary(RunMetadata* metadata) {
  *device_partition_graph->add_node() = *node_def;
  }
  }
  - }
  +
  return Summary();
  }
  