Bug 997963, part 5 - Remove some useless OOM checks from nsStringBundleService. r=ehsan
authorAndrew McCreight <continuation@gmail.com>
Mon, 21 Apr 2014 09:41:57 -0700
changeset 179814 efb8d769808993e8425a28c15d692cd752334975
parent 179813 b7694e60758e8feaf4700285307b449722f4f441
child 179815 34473bcef1b75424e6277dbf7328a511bf61c5ff
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersehsan
bugs997963
milestone31.0a1
Bug 997963, part 5 - Remove some useless OOM checks from nsStringBundleService. r=ehsan
intl/strres/src/nsStringBundle.cpp
--- a/intl/strres/src/nsStringBundle.cpp
+++ b/intl/strres/src/nsStringBundle.cpp
@@ -585,17 +585,16 @@ nsStringBundleService::getStringBundle(c
     // remove it from the list, it will later be reinserted
     // at the head of the list
     cacheEntry->remove();
 
   } else {
 
     // hasn't been cached, so insert it into the hash table
     nsStringBundle* bundle = new nsStringBundle(aURLSpec, mOverrideStrings);
-    if (!bundle) return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(bundle);
 
     cacheEntry = insertIntoCache(bundle, &completeKey);
     NS_RELEASE(bundle);         // cache should now be holding a ref
                                 // in the cacheEntry
   }
 
   // at this point the cacheEntry should exist in the hashtable,
@@ -663,17 +662,16 @@ NS_IMETHODIMP
 nsStringBundleService::CreateExtensibleBundle(const char* aCategory,
                                               nsIStringBundle** aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
 
   nsresult res;
 
   nsExtensibleStringBundle * bundle = new nsExtensibleStringBundle();
-  if (!bundle) return NS_ERROR_OUT_OF_MEMORY;
 
   res = bundle->Init(aCategory, this);
   if (NS_FAILED(res)) {
     delete bundle;
     return res;
   }
 
   res = bundle->QueryInterface(NS_GET_IID(nsIStringBundle), (void**) aResult);