]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/VisitedState.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Declare local variables inside the if statement.
[simgrid.git] / src / mc / VisitedState.cpp
index 873154cc3ee1037222ac6d0c7b7b280b739730ce..16a667614daf56a21039c0f80415530c0291579d 100644 (file)
@@ -48,10 +48,10 @@ VisitedStates::addVisitedState(unsigned long state_number, simgrid::mc::State* g
   XBT_DEBUG("Snapshot %p of visited state %ld (exploration stack state %ld)", new_state->system_state.get(),
             new_state->num, graph_state->get_num());
 
-  auto range = boost::range::equal_range(states_, new_state.get(), Api::get().compare_pair());
+  auto [range_begin, range_end] = boost::range::equal_range(states_, new_state.get(), Api::get().compare_pair());
 
   if (compare_snapshots)
-    for (auto i = range.first; i != range.second; ++i) {
+    for (auto i = range_begin; i != range_end; ++i) {
       auto& visited_state = *i;
       if (Api::get().snapshot_equal(visited_state->system_state.get(), new_state->system_state.get())) {
         // The state has been visited:
@@ -81,7 +81,7 @@ VisitedStates::addVisitedState(unsigned long state_number, simgrid::mc::State* g
     }
 
   XBT_DEBUG("Insert new visited state %ld (total : %lu)", new_state->num, (unsigned long)states_.size());
-  states_.insert(range.first, std::move(new_state));
+  states_.insert(range_begin, std::move(new_state));
   this->prune();
   return nullptr;
 }