if (aArray->Count() - aCacheStart >= aCacheSize){ res = RemoveLastMenuItem(container, aArray); if (NS_FAILED(res)) return res; }
nsCOMPtr<nsIRDFContainer> container;
nsresult nsCharsetMenu::AddCharsetToCache(                        nsIAtom * aCharset,                        nsVoidArray * aArray,                        nsIRDFResource * aRDFResource,                         PRInt32 aCacheStart, 						PRInt32 aCacheSize,						PRInt32 aRDFPlace){  PRInt32 i;  nsresult res = NS_OK;  i = FindMenuItemInArray(aArray, aCharset, NULL);  if (i >= 0) return res;  nsCOMPtr<nsIRDFContainer> container;  res = NewRDFContainer(mInner, aRDFResource, getter_AddRefs(container));  if (NS_FAILED(res)) return res;  // iff too many items, remove last one  if (aArray->Count() - aCacheStart >= aCacheSize){    res = RemoveLastMenuItem(container, aArray);    if (NS_FAILED(res)) return res;  }  res = AddCharsetToContainer(aArray, container, aCharset, "charset.",     aCacheStart, aRDFPlace);  return res;}