Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #357 from apple/shahmishal/apple/stable/20190619
Browse files Browse the repository at this point in the history
Cleanup: llvm::bsearch -> llvm::partition_point after r364719
  • Loading branch information
shahmishal authored Oct 2, 2019
2 parents 680e510 + 896041f commit eeafed2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Tooling/Syntax/Tokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ TokenBuffer::spelledForExpandedToken(const syntax::Token *Expanded) const {

unsigned ExpandedIndex = Expanded - ExpandedTokens.data();
// Find the first mapping that produced tokens after \p Expanded.
auto It = llvm::bsearch(File.Mappings, [&](const Mapping &M) {
return ExpandedIndex < M.BeginExpanded;
auto It = llvm::partition_point(File.Mappings, [&](const Mapping &M) {
return M.BeginExpanded <= ExpandedIndex;
});
// Our token could only be produced by the previous mapping.
if (It == File.Mappings.begin()) {
Expand Down Expand Up @@ -211,8 +211,8 @@ TokenBuffer::expansionStartingAt(const syntax::Token *Spelled) const {
Spelled < (File.SpelledTokens.data() + File.SpelledTokens.size()));

unsigned SpelledIndex = Spelled - File.SpelledTokens.data();
auto M = llvm::bsearch(File.Mappings, [&](const Mapping &M) {
return SpelledIndex <= M.BeginSpelled;
auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) {
return M.BeginSpelled < SpelledIndex;
});
if (M == File.Mappings.end() || M->BeginSpelled != SpelledIndex)
return llvm::None;
Expand Down

0 comments on commit eeafed2

Please sign in to comment.