mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 14:23:10 -05:00
Merge topic 'string-prefix'
ec7928ef26use _s to construct static string_views at several places94de927cabVS10Generator: avoid many string allocations8ca2504a4duse string_views to avoid memory allocations761f1adcaecheck for a valid URL scheme before starting to do any splittingef778d77e0replace std::string::substr() with operations that do not allocate memory77616f4681pass cm::string_view to cmVisualStudioSlnParser::ParseTag()ada6a3226fuse cm::string_view for language extension lookups48adc29721replace "std::string::find(x) == 0" with cmHasPrefix() ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4501
This commit is contained in:
@@ -32,14 +32,14 @@ void compare(const char* refName, const char* testName)
|
||||
// trailing null to the string that we need to strip before testing for a
|
||||
// trailing space.
|
||||
if (refLine.size() && refLine[refLine.size() - 1] == 0) {
|
||||
refLine = refLine.substr(0, refLine.size() - 1);
|
||||
refLine.resize(refLine.size() - 1);
|
||||
}
|
||||
if (testLine.size() && testLine[testLine.size() - 1] == 0) {
|
||||
testLine = testLine.substr(0, testLine.size() - 1);
|
||||
testLine.resize(testLine.size() - 1);
|
||||
}
|
||||
// The reference files never have trailing spaces:
|
||||
if (testLine.size() && testLine[testLine.size() - 1] == ' ') {
|
||||
testLine = testLine.substr(0, testLine.size() - 1);
|
||||
testLine.resize(testLine.size() - 1);
|
||||
}
|
||||
if (refLine != testLine) {
|
||||
std::cout << "Ref and test are not the same:\n Ref: \"" << refLine
|
||||
|
||||
Reference in New Issue
Block a user