@@ -236,7 +236,7 @@ ContextFreeCodeCompletionResult::getCodeCompletionOperatorKind(
236
236
using CCOK = CodeCompletionOperatorKind;
237
237
using OpPair = std::pair<StringRef, CCOK>;
238
238
239
- // This list must be kept in alphabetical order.
239
+ // This list must be kept in lexicographic order.
240
240
static OpPair ops[] = {
241
241
std::make_pair (" !" , CCOK::Bang),
242
242
std::make_pair (" !=" , CCOK::NotEq),
@@ -280,13 +280,12 @@ ContextFreeCodeCompletionResult::getCodeCompletionOperatorKind(
280
280
std::make_pair (" ||" , CCOK::PipePipe),
281
281
std::make_pair (" ~=" , CCOK::TildeEq),
282
282
};
283
- static auto opsSize = sizeof (ops) / sizeof (ops[0 ]);
284
283
285
284
auto I = std::lower_bound (
286
- ops, & ops[opsSize] , std::make_pair (name, CCOK::None),
285
+ std::begin ( ops), std::end ( ops) , std::make_pair (name, CCOK::None),
287
286
[](const OpPair &a, const OpPair &b) { return a.first < b.first ; });
288
287
289
- if (I == & ops[opsSize] || I->first != name)
288
+ if (I == std::end ( ops) || I->first != name)
290
289
return CCOK::Unknown;
291
290
return I->second ;
292
291
}
0 commit comments