Fixing bug 232503. Start using Empty[C]String() to save a bit on code-size. r+sr=peterv@propagandism.org

This commit is contained in:
jst%mozilla.jstenback.com 2005-11-02 07:41:51 +00:00
Родитель 23ea5d1b73
Коммит 4390f436da
3 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -376,10 +376,12 @@ txCopy::execute(txExecutionState& aEs)
switch (txXPathNodeUtils::getNodeType(node)) {
case txXPathNodeType::DOCUMENT_NODE:
{
// "close" current element to ensure that no attributes are added
aEs.mResultHandler->characters(NS_LITERAL_STRING(""), PR_FALSE);
const nsAFlatString& empty = EmptyString();
rv = aEs.pushString(NS_LITERAL_STRING(""));
// "close" current element to ensure that no attributes are added
aEs.mResultHandler->characters(empty, PR_FALSE);
rv = aEs.pushString(empty);
NS_ENSURE_SUCCESS(rv, rv);
rv = aEs.pushInt(kNameSpaceID_None);
@ -408,7 +410,7 @@ txCopy::execute(txExecutionState& aEs)
{
rv = copyNode(node, aEs);
NS_ENSURE_SUCCESS(rv, rv);
aEs.gotoInstruction(mBailTarget);
}
}

Просмотреть файл

@ -323,7 +323,7 @@ nsresult txXSLKey::indexDocument(const txXPathNode& aDocument,
{
txKeyValueHashKey key(mName,
txXPathNodeUtils::getUniqueIdentifier(aDocument),
NS_LITERAL_STRING(""));
EmptyString());
return indexTree(aDocument, key, aKeyValueHash, aEs);
}

Просмотреть файл

@ -1133,7 +1133,7 @@ txFnEndTopVariable(txStylesheetCompilerState& aState)
// No children were found.
NS_ASSERTION(!var->mValue,
"There shouldn't be a select-expression here");
var->mValue = new txLiteralExpr(NS_LITERAL_STRING(""));
var->mValue = new txLiteralExpr(EmptyString());
NS_ENSURE_TRUE(var->mValue, NS_ERROR_OUT_OF_MEMORY);
}
else if (!var->mValue) {
@ -2128,7 +2128,7 @@ txFnEndParam(txStylesheetCompilerState& aState)
// No children were found.
NS_ASSERTION(!var->mValue,
"There shouldn't be a select-expression here");
var->mValue = new txLiteralExpr(NS_LITERAL_STRING(""));
var->mValue = new txLiteralExpr(EmptyString());
NS_ENSURE_TRUE(var->mValue, NS_ERROR_OUT_OF_MEMORY);
}
@ -2406,7 +2406,7 @@ txFnEndVariable(txStylesheetCompilerState& aState)
// No children were found.
NS_ASSERTION(!var->mValue,
"There shouldn't be a select-expression here");
var->mValue = new txLiteralExpr(NS_LITERAL_STRING(""));
var->mValue = new txLiteralExpr(EmptyString());
NS_ENSURE_TRUE(var->mValue, NS_ERROR_OUT_OF_MEMORY);
}
@ -2569,7 +2569,7 @@ txFnEndWithParam(txStylesheetCompilerState& aState)
// No children were found.
NS_ASSERTION(!var->mValue,
"There shouldn't be a select-expression here");
var->mValue = new txLiteralExpr(NS_LITERAL_STRING(""));
var->mValue = new txLiteralExpr(EmptyString());
NS_ENSURE_TRUE(var->mValue, NS_ERROR_OUT_OF_MEMORY);
}