Reduce amount of string allocation, and delete []basename when done with it.

This commit is contained in:
rjc%netscape.com 1999-03-13 09:32:13 +00:00
parent 68b5fd27ca
commit 9ad0260123

View File

@ -910,14 +910,11 @@ GetName(nsIRDFResource *source, nsVoidArray **array)
char *basename = native.GetLeafName();
if (basename)
{
nsString *name = new nsString(basename);
if (nsnull != name)
{
nsIRDFLiteral *literal;
gRDFService->GetLiteral(*name, &literal);
nameArray->AppendElement(literal);
delete name;
}
nsAutoString name(basename);
nsIRDFLiteral *literal;
gRDFService->GetLiteral(name, &literal);
nameArray->AppendElement(literal);
delete []basename;
}
return(NS_OK);
}