Utils: Convert to SmallStringView for comparison

Change-Id: I38d9716225b81091e8e75b26c9c2258a2aefa987
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2017-08-29 12:54:10 +02:00
parent 7c0331ab93
commit 8640ef1927
26 changed files with 187 additions and 195 deletions

View File

@@ -66,24 +66,24 @@ template <typename Source,
typename Target>
void append(Target &target, const Source &source)
{
using ValueType = typename Target::value_type;
Source clonedSource = source.clone();
target.reserve(target.size() + source.size());
std::move(clonedSource.begin(),
clonedSource.end(),
std::back_inserter(target));
for(auto &&entry : clonedSource)
target.push_back(ValueType(std::move(entry)));
}
template <typename Source,
typename Target>
void append(Target &target, Source &source)
{
using ValueType = typename Target::value_type;
target.reserve(target.size() + source.size());
std::move(source.begin(),
source.end(),
std::back_inserter(target));
for(auto &&entry : source)
target.push_back(ValueType(entry));
}
template <typename GetterFunction>
@@ -469,14 +469,14 @@ std::vector<uint> PchCreator::generateProjectPartPchIncludes(
auto jointFile = generateFileWithContent(jointedFilePath, jointedFileContent);
Utils::SmallStringVector arguments = generateProjectPartCommandLine(projectPart);
arguments.push_back(jointedFilePath);
FilePath filePath(jointedFilePath.clone());
FilePath filePath{Utils::PathString(jointedFilePath)};
IncludeCollector collector(m_filePathCache);
collector.setExcludedIncludes(generateProjectPartHeaderAndSourcePaths(projectPart));
collector.addFile(filePath.directory(),
filePath.name(),
collector.addFile(std::string(filePath.directory()),
std::string(filePath.name()),
{},
arguments);
@@ -581,11 +581,11 @@ std::unique_ptr<QFile> PchCreator::generateFileWithContent(
const Utils::SmallString &filePath,
const Utils::SmallString &content)
{
std::unique_ptr<QFile> precompiledIncludeFile(new QFile(filePath));
std::unique_ptr<QFile> precompiledIncludeFile(new QFile(QString(filePath)));
precompiledIncludeFile->open(QIODevice::WriteOnly);
precompiledIncludeFile->write(content.data(), content.size());
precompiledIncludeFile->write(content.data(), qint64(content.size()));
precompiledIncludeFile->close();
return precompiledIncludeFile;