mirror of
https://github.com/aria2/aria2.git
synced 2025-01-04 09:03:46 +00:00
FileEntry: Pass by value for simple setter functions
This commit is contained in:
parent
caf7213bad
commit
a21a868af0
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user