From afa29d5e6686df664643e001a7a089fb8983f50e Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Tue, 8 Apr 2025 17:37:52 +0200 Subject: [PATCH] Fix clang-tidy: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] (#5268) --- toolchain/check/scope_stack.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolchain/check/scope_stack.cpp b/toolchain/check/scope_stack.cpp index 27af13544444..f49f78e38beb 100644 --- a/toolchain/check/scope_stack.cpp +++ b/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; if (scope_index.has_value()) { 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(); CARBON_CHECK(scope_stack_[scope_depth].index == scope_index, "Declaring name in scope that has already ended");