FileEntry: Pass by value for simple setter functions

This commit is contained in:
Tatsuhiro Tsujikawa 2013-12-15 19:20:31 +09:00
parent caf7213bad
commit a21a868af0
2 changed files with 9 additions and 9 deletions

View File

@ -546,14 +546,14 @@ bool FileEntry::insertUri(const std::string& uri, size_t pos)
return true;
}
void FileEntry::setPath(const std::string& path)
void FileEntry::setPath(std::string path)
{
path_ = path;
path_ = std::move(path);
}
void FileEntry::setContentType(const std::string& contentType)
void FileEntry::setContentType(std::string contentType)
{
contentType_ = contentType;
contentType_ = std::move(contentType);
}
size_t FileEntry::countInFlightRequest() const
@ -566,9 +566,9 @@ size_t FileEntry::countPooledRequest() const
return requestPool_.size();
}
void FileEntry::setOriginalName(const std::string& originalName)
void FileEntry::setOriginalName(std::string originalName)
{
originalName_ = originalName;
originalName_ = std::move(originalName);
}
bool FileEntry::emptyRequestUri() const

View File

@ -109,7 +109,7 @@ public:
const std::string& getPath() const { return path_; }
void setPath(const std::string& path);
void setPath(std::string path);
int64_t getLength() const { return length_; }
@ -167,7 +167,7 @@ public:
// Inserts uris_ and spentUris_ into uris.
void getUris(std::vector<std::string>& uris) const;
void setContentType(const std::string& contentType);
void setContentType(std::string contentType);
const std::string& getContentType() const { return contentType_; }
@ -257,7 +257,7 @@ public:
// Push URIs in pooled or in-flight requests to the front of uris_.
void putBackRequest();
void setOriginalName(const std::string& originalName);
void setOriginalName(std::string originalName);
const std::string& getOriginalName() const
{