bug 108962 - shrink nsStr by 4 bytes by packing mCharSize and mOwnsBuffer into bits of mCapacity

r=dbaron, sr=jst, with an almost-sr=jag


git-svn-id: svn://10.0.0.236/trunk@112769 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alecf%netscape.com
2002-01-24 23:46:56 +00:00
parent 9037da04af
commit ce5f992cb4
12 changed files with 574 additions and 522 deletions

View File

@@ -211,13 +211,13 @@ ToNewUTF8String( const nsAString& aSource )
NS_ConvertUCS2toUTF8 temp(aSource);
char* result;
if (temp.mOwnsBuffer) {
if (temp.GetOwnsBuffer()) {
// We allocated. Trick the string into not freeing its buffer to
// avoid an extra allocation.
result = temp.mStr;
temp.mStr=0;
temp.mOwnsBuffer = PR_FALSE;
temp.SetOwnsBuffer(PR_FALSE);
}
else {
// We didn't allocate a buffer, so we need to copy it out of the
@@ -385,7 +385,7 @@ void
ToUpperCase( nsCString& aCString )
{
ConvertToUpperCase converter;
converter.write(aCString.mStr, aCString.mLength);
converter.write(aCString.mStr, aCString.Length());
}
/**
@@ -479,7 +479,7 @@ void
ToLowerCase( nsCString& aCString )
{
ConvertToLowerCase converter;
converter.write(aCString.mStr, aCString.mLength);
converter.write(aCString.mStr, aCString.Length());
}
/**