From 4e35b51517cc45d0a2eaf02dbceb2bfadb16e6b5 Mon Sep 17 00:00:00 2001 From: dwight Date: Tue, 7 Sep 2010 12:51:30 -0400 Subject: [PATCH] make last commit link --- db/namespace-inl.h | 19 ++++++++++++++----- db/namespace.cpp | 8 -------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/db/namespace-inl.h b/db/namespace-inl.h index 7ecccd9ee02..707e5a2d11c 100644 --- a/db/namespace-inl.h +++ b/db/namespace-inl.h @@ -1,12 +1,12 @@ -namespace mongo { - +namespace mongo { + inline Namespace& Namespace::operator=(const char *ns) { uassert( 10080 , "ns name too long, max size is 128", strlen(ns) < MaxNsLen); //memset(buf, 0, MaxNsLen); /* this is just to keep stuff clean in the files for easy dumping and reading */ strcpy_s(buf, MaxNsLen, ns); return *this; } - + inline string Namespace::extraName(int i) const { char ex[] = "$extra"; ex[5] += i; @@ -29,5 +29,14 @@ namespace mongo { } return (x & 0x7fffffff) | 0x8000000; // must be > 0 } - -} + + /* future : this doesn't need to be an inline. */ + inline string Namespace::getSisterNS( const char * local ) const { + assert( local && local[0] != '.' ); + string old(buf); + if ( old.find( "." ) != string::npos ) + old = old.substr( 0 , old.find( "." ) ); + return old + "." + local; + } + +} diff --git a/db/namespace.cpp b/db/namespace.cpp index d9d9a315e73..00d91473f78 100644 --- a/db/namespace.cpp +++ b/db/namespace.cpp @@ -44,14 +44,6 @@ namespace mongo { 0x400000, 0x800000 }; - string Namespace::getSisterNS( const char * local ) const { - assert( local && local[0] != '.' ); - string old(buf); - if ( old.find( "." ) != string::npos ) - old = old.substr( 0 , old.find( "." ) ); - return old + "." + local; - } - NamespaceDetails::NamespaceDetails( const DiskLoc &loc, bool _capped ) { /* be sure to initialize new fields here -- doesn't default to zeroes the way we use it */ firstExtent = lastExtent = capExtent = loc;