mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Replace is_sorted with comparison (#1104)
* Replace is_sorted with comparison * Switch to StringRefContainsPointer
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
static constexpr llvm::StringRef TripleQuotes = "\"\"\"";
|
||||
static constexpr llvm::StringRef TripleQuotes = R"(""")";
|
||||
static constexpr llvm::StringRef HorizontalWhitespaceChars = " \t";
|
||||
|
||||
// Carbon only takes uppercase hex input.
|
||||
@@ -169,4 +169,9 @@ auto ParseBlockStringLiteral(llvm::StringRef source)
|
||||
return parsed;
|
||||
}
|
||||
|
||||
auto StringRefContainsPointer(llvm::StringRef ref, const char* ptr) -> bool {
|
||||
auto le = std::less_equal<const char*>();
|
||||
return le(ref.begin(), ptr) && le(ptr, ref.end());
|
||||
}
|
||||
|
||||
} // namespace Carbon
|
||||
|
||||
Reference in New Issue
Block a user