Skip to content

Commit 589e7ab

Browse files
[clang-tidy] Use std::binary_search (NFC) (llvm#140263)
1 parent 82bad53 commit 589e7ab

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ bool MagicNumbersCheck::isIgnoredValue(const IntegerLiteral *Literal) const {
202202
if (IgnorePowersOf2IntegerValues && IntValue.isPowerOf2())
203203
return true;
204204

205-
return std::binary_search(IgnoredIntegerValues.begin(),
206-
IgnoredIntegerValues.end(), Value);
205+
return llvm::binary_search(IgnoredIntegerValues, Value);
207206
}
208207

209208
bool MagicNumbersCheck::isIgnoredValue(const FloatingLiteral *Literal) const {
@@ -213,14 +212,12 @@ bool MagicNumbersCheck::isIgnoredValue(const FloatingLiteral *Literal) const {
213212

214213
if (&FloatValue.getSemantics() == &llvm::APFloat::IEEEsingle()) {
215214
const float Value = FloatValue.convertToFloat();
216-
return std::binary_search(IgnoredFloatingPointValues.begin(),
217-
IgnoredFloatingPointValues.end(), Value);
215+
return llvm::binary_search(IgnoredFloatingPointValues, Value);
218216
}
219217

220218
if (&FloatValue.getSemantics() == &llvm::APFloat::IEEEdouble()) {
221219
const double Value = FloatValue.convertToDouble();
222-
return std::binary_search(IgnoredDoublePointValues.begin(),
223-
IgnoredDoublePointValues.end(), Value);
220+
return llvm::binary_search(IgnoredDoublePointValues, Value);
224221
}
225222

226223
return false;

0 commit comments

Comments
 (0)