From 296d6e6a52d3583c823cce81b4e1cb89a43b3b36 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Fri, 10 Aug 2012 22:50:54 -0400 Subject: Revert "Speed-up dur::filename()" This reverts commit 066d794339538fb020ec0fe9a27be981ea75b0a9. Conflicts: src/mongo/db/dur_recover.cpp --- src/mongo/db/dur_recover.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src') 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() { -- cgit v1.2.1