Bug 1323904 - Remove the return value from nsStringBundleService::getStringBundle(). r=emk.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 16 Dec 2016 13:31:22 +1100
changeset 371142 ee6bed727c3d65bf01762afe3be742ca0f7b1440
parent 371141 7d52433eca7b39c86cb346d192d659f5e2cbc179
child 371143 58bb89b2995dd148012a372bb612b18b6c411e3c
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs1323904
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1323904 - Remove the return value from nsStringBundleService::getStringBundle(). r=emk. It's unused.
intl/strres/nsStringBundle.cpp
intl/strres/nsStringBundleService.h
--- a/intl/strres/nsStringBundle.cpp
+++ b/intl/strres/nsStringBundle.cpp
@@ -572,17 +572,17 @@ nsStringBundleService::flushBundleCache(
 
 NS_IMETHODIMP
 nsStringBundleService::FlushBundles()
 {
   flushBundleCache();
   return NS_OK;
 }
 
-nsresult
+void
 nsStringBundleService::getStringBundle(const char *aURLSpec,
                                        nsIStringBundle **aResult)
 {
   nsDependentCString key(aURLSpec);
   bundleCacheEntry_t* cacheEntry = mBundleMap.Get(key);
 
   if (cacheEntry) {
     // cache hit!
@@ -600,18 +600,16 @@ nsStringBundleService::getStringBundle(c
   // at this point the cacheEntry should exist in the hashtable,
   // but is not in the LRU cache.
   // put the cache entry at the front of the list
   mBundleCache.insertFront(cacheEntry);
 
   // finally, return the value
   *aResult = cacheEntry->mBundle;
   NS_ADDREF(*aResult);
-
-  return NS_OK;
 }
 
 bundleCacheEntry_t *
 nsStringBundleService::insertIntoCache(already_AddRefed<nsIStringBundle> aBundle,
                                        nsCString &aHashKey)
 {
   bundleCacheEntry_t *cacheEntry;
 
@@ -640,17 +638,18 @@ nsStringBundleService::insertIntoCache(a
 
   return cacheEntry;
 }
 
 NS_IMETHODIMP
 nsStringBundleService::CreateBundle(const char* aURLSpec,
                                     nsIStringBundle** aResult)
 {
-  return getStringBundle(aURLSpec,aResult);
+  getStringBundle(aURLSpec,aResult);
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsStringBundleService::CreateExtensibleBundle(const char* aCategory,
                                               nsIStringBundle** aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
   *aResult = nullptr;
@@ -741,26 +740,22 @@ nsStringBundleService::FormatStatusMessa
       offset = pos + 1;
     }
   }
 
   // find the string bundle for the error's module:
   rv = mErrorService->GetErrorStringBundle(NS_ERROR_GET_MODULE(aStatus),
                                            getter_Copies(stringBundleURL));
   if (NS_SUCCEEDED(rv)) {
-    rv = getStringBundle(stringBundleURL, getter_AddRefs(bundle));
-    if (NS_SUCCEEDED(rv)) {
-      rv = FormatWithBundle(bundle, aStatus, argCount, argArray, result);
-    }
+    getStringBundle(stringBundleURL, getter_AddRefs(bundle));
+    rv = FormatWithBundle(bundle, aStatus, argCount, argArray, result);
   }
   if (NS_FAILED(rv)) {
-    rv = getStringBundle(GLOBAL_PROPERTIES, getter_AddRefs(bundle));
-    if (NS_SUCCEEDED(rv)) {
-      rv = FormatWithBundle(bundle, aStatus, argCount, argArray, result);
-    }
+    getStringBundle(GLOBAL_PROPERTIES, getter_AddRefs(bundle));
+    rv = FormatWithBundle(bundle, aStatus, argCount, argArray, result);
   }
 
 done:
   if (argCount > 1) {
     for (i = 0; i < argCount; i++) {
       if (argArray[i])
         free(argArray[i]);
     }
--- a/intl/strres/nsStringBundleService.h
+++ b/intl/strres/nsStringBundleService.h
@@ -31,17 +31,17 @@ public:
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISTRINGBUNDLESERVICE
   NS_DECL_NSIOBSERVER
 
 private:
   virtual ~nsStringBundleService();
 
-  nsresult getStringBundle(const char *aUrl, nsIStringBundle** aResult);
+  void getStringBundle(const char *aUrl, nsIStringBundle** aResult);
   nsresult FormatWithBundle(nsIStringBundle* bundle, nsresult aStatus,
                             uint32_t argCount, char16_t** argArray,
                             char16_t* *result);
 
   void flushBundleCache();
 
   bundleCacheEntry_t *insertIntoCache(already_AddRefed<nsIStringBundle> aBundle,
                                       nsCString &aHashKey);