forked from qt-creator/qt-creator
Utils: Add endsWith to SmallStringView
Change-Id: Iea8286b46c28a68b26904e256b9f084c32c79909 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -106,6 +106,11 @@ public:
|
||||
{
|
||||
return *begin() == characterToSearch;
|
||||
}
|
||||
|
||||
constexpr bool endsWith(SmallStringView ending) const noexcept
|
||||
{
|
||||
return size() >= ending.size() && std::equal(ending.rbegin(), ending.rend(), rbegin());
|
||||
}
|
||||
};
|
||||
|
||||
constexpr bool operator==(SmallStringView first, SmallStringView second) noexcept
|
||||
|
||||
Reference in New Issue
Block a user