mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
faster
This commit is contained in:
parent
6691b05e5b
commit
8f98101ecb
@ -31,15 +31,10 @@ namespace mongo {
|
||||
// if profiling indicates this method is a significant bottleneck, we could have a version we
|
||||
// use for reads which does not fill with zeroes, and keep the zeroing behavior on writes.
|
||||
//
|
||||
int i = 0;
|
||||
while( ns[i] ) {
|
||||
buf[i] = ns[i];
|
||||
if( ++i >= MaxNsLen-1 )
|
||||
uasserted( 10080 , "ns name too long, max size is 128" );
|
||||
}
|
||||
do {
|
||||
buf[i++] = 0;
|
||||
} while( i < MaxNsLen );
|
||||
unsigned len = strlen(ns);
|
||||
uassert( 10080 , "ns name too long, max size is 128", len < MaxNsLen);
|
||||
memset(buf, 0, MaxNsLen);
|
||||
memcpy(buf, ns, len);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user