diff options
author | Tad Marshall <tad@10gen.com> | 2012-08-02 05:55:24 -0400 |
---|---|---|
committer | Tad Marshall <tad@10gen.com> | 2012-08-31 11:44:37 -0400 |
commit | 15624a7a7e60ce1f50fc50f6cba54398b2af17d2 (patch) | |
tree | a6f830ee48e31ad7a0a69bd13fe97fa42c16b94e /src/mongo/util/mmap.cpp | |
parent | 1f8725142aee6cd4598ff360f638055e44557bec (diff) | |
download | mongo-15624a7a7e60ce1f50fc50f6cba54398b2af17d2.tar.gz |
SERVER-6908 Don't pass strings by value
Change lots of code to take <string> arguments by const ref instead
of by value; minor changes to surrounding code.
Diffstat (limited to 'src/mongo/util/mmap.cpp')
-rw-r--r-- | src/mongo/util/mmap.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/util/mmap.cpp b/src/mongo/util/mmap.cpp index bedbd70fb44..756f46e4c07 100644 --- a/src/mongo/util/mmap.cpp +++ b/src/mongo/util/mmap.cpp @@ -44,7 +44,7 @@ namespace mongo { /* Create. Must not exist. @param zero fill file with zeros when true */ - void* MemoryMappedFile::create(string filename, unsigned long long len, bool zero) { + void* MemoryMappedFile::create(const std::string& filename, unsigned long long len, bool zero) { uassert( 13468, string("can't create file already exists ") + filename, ! boost::filesystem::exists(filename) ); void *p = map(filename.c_str(), len); if( p && zero ) { @@ -190,7 +190,7 @@ namespace mongo { mmfiles.insert(this); } - void MongoFile::setFilename(string fn) { + void MongoFile::setFilename(const std::string& fn) { LockMongoFilesExclusive lk; verify( _filename.empty() ); _filename = fn; |