diff --git a/intl/strres/src/nsStringBundle.cpp b/intl/strres/src/nsStringBundle.cpp index 21c3d04f0c90..b748f3c7fb2c 100644 --- a/intl/strres/src/nsStringBundle.cpp +++ b/intl/strres/src/nsStringBundle.cpp @@ -469,37 +469,30 @@ nsExtensibleStringBundle::~nsExtensibleStringBundle() nsresult nsExtensibleStringBundle::GetStringFromID(PRInt32 aID, PRUnichar ** aResult) { nsresult rv; - - PRUint32 size, i; - - size = mBundles.Count(); - - for (i = 0; i < size; i++) { + const PRUint32 size = mBundles.Count(); + for (PRUint32 i = 0; i < size; ++i) { nsIStringBundle *bundle = mBundles[i]; if (bundle) { - rv = bundle->GetStringFromID(aID, aResult); - if (NS_SUCCEEDED(rv)) - return NS_OK; + rv = bundle->GetStringFromID(aID, aResult); + if (NS_SUCCEEDED(rv)) + return NS_OK; } } return NS_ERROR_FAILURE; } -nsresult nsExtensibleStringBundle::GetStringFromName(const PRUnichar *aName, +nsresult nsExtensibleStringBundle::GetStringFromName(const PRUnichar *aName, PRUnichar ** aResult) { - nsresult res = NS_OK; - PRUint32 size, i; - - size = mBundles.Count(); - - for (i = 0; i < size; i++) { + nsresult rv; + const PRUint32 size = mBundles.Count(); + for (PRUint32 i = 0; i < size; ++i) { nsIStringBundle* bundle = mBundles[i]; if (bundle) { - res = bundle->GetStringFromName(aName, aResult); - if (NS_SUCCEEDED(res)) - return NS_OK; + rv = bundle->GetStringFromName(aName, aResult); + if (NS_SUCCEEDED(rv)) + return NS_OK; } } @@ -747,14 +740,14 @@ nsStringBundleService::CreateBundle(const char* aURLSpec, return getStringBundle(aURLSpec,aResult); } - + NS_IMETHODIMP -nsStringBundleService::CreateExtensibleBundle(const char* aCategory, +nsStringBundleService::CreateExtensibleBundle(const char* aCategory, nsIStringBundle** aResult) { if (aResult == NULL) return NS_ERROR_NULL_POINTER; - nsresult res = NS_OK; + nsresult res; nsExtensibleStringBundle * bundle = new nsExtensibleStringBundle(); if (!bundle) return NS_ERROR_OUT_OF_MEMORY;