A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Use first/last instead of start/end in ObjectInformation::remove_global_variable()
[simgrid.git]
/
src
/
mc
/
ObjectInformation.cpp
diff --git
a/src/mc/ObjectInformation.cpp
b/src/mc/ObjectInformation.cpp
index
94134d6
..
08a75fa
100644
(file)
--- a/
src/mc/ObjectInformation.cpp
+++ b/
src/mc/ObjectInformation.cpp
@@
-108,32
+108,35
@@
void ObjectInformation::remove_global_variable(const char* name)
return;
// Binary search:
return;
// Binary search:
- size_type
star
t = 0;
- size_type
end
= this->global_variables.size() - 1;
+ size_type
firs
t = 0;
+ size_type
last
= this->global_variables.size() - 1;
- while (
start <= end
) {
- size_type cursor =
start + (end - star
t) / 2;
+ while (
first <= last
) {
+ size_type cursor =
first + (last - firs
t) / 2;
simgrid::mc::Variable& current_var = this->global_variables[cursor];
int cmp = current_var.name.compare(name);
if (cmp == 0) {
simgrid::mc::Variable& current_var = this->global_variables[cursor];
int cmp = current_var.name.compare(name);
if (cmp == 0) {
+
// Find the whole range:
// Find the whole range:
- s
tar
t = cursor;
- while (
start != 0 && this->global_variables[star
t - 1].name == name)
-
star
t--;
+ s
ize_type firs
t = cursor;
+ while (
first != 0 && this->global_variables[firs
t - 1].name == name)
+
firs
t--;
size_type size = this->global_variables.size();
size_type size = this->global_variables.size();
- end = cursor;
- while (end != size - 1 && this->global_variables[end + 1].name == name)
- end++;
+ size_type last = cursor;
+ while (last != size - 1 && this->global_variables[last + 1].name == name)
+ last++;
+
// Remove the whole range:
this->global_variables.erase(
// Remove the whole range:
this->global_variables.erase(
- this->global_variables.begin() + start,
- this->global_variables.begin() + end + 1);
+ this->global_variables.begin() + first,
+ this->global_variables.begin() + last + 1);
+
return;
} else if (cmp < 0)
return;
} else if (cmp < 0)
-
star
t = cursor + 1;
+
firs
t = cursor + 1;
else if (cursor != 0)
else if (cursor != 0)
-
end
= cursor - 1;
+
last
= cursor - 1;
else
break;
}
else
break;
}