Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar: explict
[simgrid.git] / src / mc / ObjectInformation.cpp
index a8de56b..18c2da3 100644 (file)
@@ -81,9 +81,9 @@ simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const
   return nullptr;
 }
 
-simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const
+const simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const
 {
-  for (simgrid::mc::Variable& variable : this->global_variables)
+  for (simgrid::mc::Variable const& variable : this->global_variables)
     if(variable.name == name)
       return &variable;
   return nullptr;
@@ -108,11 +108,11 @@ void ObjectInformation::remove_global_variable(const char* name)
     if (cmp == 0) {
 
       // Find the whole range:
-      size_type first = cursor;
+      first = cursor;
       while (first != 0 && this->global_variables[first - 1].name == name)
         first--;
       size_type size = this->global_variables.size();
-      size_type last = cursor;
+      last           = cursor;
       while (last != size - 1 && this->global_variables[last + 1].name == name)
         last++;