mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-01 05:43:46 +00:00
Reduce amount of string allocation, and delete []basename when done with it.
This commit is contained in:
parent
68b5fd27ca
commit
9ad0260123
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user