constraint_solver: remove usage of gtl:ContainsKey

This commit is contained in:
Corentin Le Molgat
2022-01-03 09:48:24 +01:00
parent 354e350004
commit 3b05c5400d

View File

@@ -384,19 +384,19 @@ void SequenceVarElement::SetUnperformed(const std::vector<int>& unperformed) {
bool SequenceVarElement::CheckClassInvariants() {
absl::flat_hash_set<int> visited;
for (const int forward_sequence : forward_sequence_) {
if (gtl::ContainsKey(visited, forward_sequence)) {
if (visited.contains(forward_sequence)) {
return false;
}
visited.insert(forward_sequence);
}
for (const int backward_sequence : backward_sequence_) {
if (gtl::ContainsKey(visited, backward_sequence)) {
if (visited.contains(backward_sequence)) {
return false;
}
visited.insert(backward_sequence);
}
for (const int unperformed : unperformed_) {
if (gtl::ContainsKey(visited, unperformed)) {
if (visited.contains(unperformed)) {
return false;
}
visited.insert(unperformed);
@@ -456,7 +456,7 @@ void IdToElementMap(AssignmentContainer<V, E>* container,
if (name.empty()) {
LOG(INFO) << "Cannot save/load variables with empty name"
<< "; variable will be ignored";
} else if (gtl::ContainsKey(*id_to_element_map, name)) {
} else if (id_to_element_map->contains(name)) {
LOG(INFO) << "Cannot save/load variables with duplicate names: " << name
<< "; variable will be ignored";
} else {