summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2012-08-10 22:50:54 -0400
committerMathias Stearn <mathias@10gen.com>2012-08-10 22:50:54 -0400
commit296d6e6a52d3583c823cce81b4e1cb89a43b3b36 (patch)
treedc70f167077ce4df812499569191b7b08e3bd8a4 /src
parentf9dc7514f4132f6fa5fa695b688aeafb4e63040e (diff)
downloadmongo-296d6e6a52d3583c823cce81b4e1cb89a43b3b36.tar.gz
Revert "Speed-up dur::filename()"
This reverts commit 066d794339538fb020ec0fe9a27be981ea75b0a9. Conflicts: src/mongo/db/dur_recover.cpp
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/dur_recover.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/mongo/db/dur_recover.cpp b/src/mongo/db/dur_recover.cpp
index 07d605ce16e..b3f4ce986a2 100644
--- a/src/mongo/db/dur_recover.cpp
+++ b/src/mongo/db/dur_recover.cpp
@@ -183,29 +183,18 @@ namespace mongo {
};
static string fileName(const char* dbName, int fileNo) {
- boost::filesystem::path full(dbpath);
-
- StackStringBuilder ss;
- ss << full.string();
-
-#ifdef _WIN32
- static const char pathSep = '\\';
-#else
- static const char pathSep = '/';
-#endif
-
- if (!dbpath.empty() && dbpath[dbpath.size()-1] != pathSep)
- ss << pathSep;
-
+ stringstream ss;
ss << dbName << '.';
verify( fileNo >= 0 );
-
if( fileNo == JEntry::DotNsSuffix )
ss << "ns";
else
ss << fileNo;
- return ss.str();
+ // relative name -> full path name
+ boost::filesystem::path full(dbpath);
+ full /= ss.str();
+ return full.string();
}
RecoveryJob::~RecoveryJob() {