Просмотр исходного кода

Fix clang-tidy: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] (#5268)

Boaz Brickner 1 год назад
Родитель
Сommit
afa29d5e66
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      toolchain/check/scope_stack.cpp

+ 4 - 4
toolchain/check/scope_stack.cpp

@@ -166,10 +166,10 @@ auto ScopeStack::LookupOrAddName(SemIR::NameId name_id, SemIR::InstId target_id,
   int scope_depth = scope_stack_.size() - 1;
   int scope_depth = scope_stack_.size() - 1;
   if (scope_index.has_value()) {
   if (scope_index.has_value()) {
     scope_depth =
     scope_depth =
-        std::lower_bound(scope_stack_.begin(), scope_stack_.end(), scope_index,
-                         [](const ScopeStackEntry& entry, ScopeIndex index) {
-                           return entry.index < index;
-                         }) -
+        llvm::lower_bound(scope_stack_, scope_index,
+                          [](const ScopeStackEntry& entry, ScopeIndex index) {
+                            return entry.index < index;
+                          }) -
         scope_stack_.begin();
         scope_stack_.begin();
     CARBON_CHECK(scope_stack_[scope_depth].index == scope_index,
     CARBON_CHECK(scope_stack_[scope_depth].index == scope_index,
                  "Declaring name in scope that has already ended");
                  "Declaring name in scope that has already ended");