Skip to content

Commit 296d6e6

Browse files
committed
Revert "Speed-up dur::filename()"
This reverts commit 066d794. Conflicts: src/mongo/db/dur_recover.cpp
1 parent f9dc751 commit 296d6e6

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

src/mongo/db/dur_recover.cpp

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -183,29 +183,18 @@ namespace mongo {
183183
};
184184

185185
static string fileName(const char* dbName, int fileNo) {
186-
boost::filesystem::path full(dbpath);
187-
188-
StackStringBuilder ss;
189-
ss << full.string();
190-
191-
#ifdef _WIN32
192-
static const char pathSep = '\\';
193-
#else
194-
static const char pathSep = '/';
195-
#endif
196-
197-
if (!dbpath.empty() && dbpath[dbpath.size()-1] != pathSep)
198-
ss << pathSep;
199-
186+
stringstream ss;
200187
ss << dbName << '.';
201188
verify( fileNo >= 0 );
202-
203189
if( fileNo == JEntry::DotNsSuffix )
204190
ss << "ns";
205191
else
206192
ss << fileNo;
207193

208-
return ss.str();
194+
// relative name -> full path name
195+
boost::filesystem::path full(dbpath);
196+
full /= ss.str();
197+
return full.string();
209198
}
210199

211200
RecoveryJob::~RecoveryJob() {

0 commit comments

Comments
 (0)