Skip to content

Commit

Permalink
FileEntry: Pass by value for simple setter functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Dec 15, 2013
1 parent caf7213 commit a21a868
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/FileEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/FileEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class FileEntry {

const std::string& getPath() const { return path_; }

void setPath(const std::string& path);
void setPath(std::string path);

int64_t getLength() const { return length_; }

Expand Down Expand Up @@ -167,7 +167,7 @@ class FileEntry {
// 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_; }

Expand Down Expand Up @@ -257,7 +257,7 @@ class FileEntry {
// 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
{
Expand Down

0 comments on commit a21a868

Please sign in to comment.