Bug 802458: Remove useless "NS_SUCCEEDED(rv)" in icon/gtk/nsIconChannel.cpp, and declare rv down where it's used. r=karlt
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 16 Oct 2012 22:18:10 -0700
changeset 110510 30332bf91baf9ccdfe7d11620a6eb9cb4f0e149c
parent 110509 9fba5058ab84be2e336debca29feed5672e0d8c7
child 110511 be4dd7c430afa1c0e1aa412e5194f812aaffc601
push id23695
push userryanvm@gmail.com
push dateWed, 17 Oct 2012 18:08:27 +0000
treeherdermozilla-central@a76c1f4c4112 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs802458
milestone19.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 802458: Remove useless "NS_SUCCEEDED(rv)" in icon/gtk/nsIconChannel.cpp, and declare rv down where it's used. r=karlt
image/decoders/icon/gtk/nsIconChannel.cpp
--- a/image/decoders/icon/gtk/nsIconChannel.cpp
+++ b/image/decoders/icon/gtk/nsIconChannel.cpp
@@ -419,18 +419,16 @@ nsIconChannel::InitWithGnome(nsIMozIconU
   return rv;
 }
 #endif // MOZ_ENABLE_GNOMEUI
 
 #ifdef MOZ_ENABLE_GIO
 nsresult
 nsIconChannel::InitWithGIO(nsIMozIconURI *aIconURI)
 {
-  nsresult rv;
-
   GIcon *icon = NULL;
   nsCOMPtr<nsIURL> fileURI;
 
   // Read icon content
   aIconURI->GetIconURL(getter_AddRefs(fileURI));
 
   // Get icon for file specified by URI
   if (fileURI) {
@@ -478,18 +476,16 @@ nsIconChannel::InitWithGIO(nsIMozIconURI
 
   // Get default icon theme
   GtkIconTheme *iconTheme = gtk_icon_theme_get_default();  
   GtkIconInfo *iconInfo = NULL;
   // Get icon size
   int32_t iconSize = GetIconSize(aIconURI);
 
   if (icon) {
-    NS_SUCCEEDED(rv);
-
     // Use icon and theme to get GtkIconInfo
     iconInfo = gtk_icon_theme_lookup_by_gicon(iconTheme,
                                               icon, iconSize,
                                               (GtkIconLookupFlags)0);
     g_object_unref(icon);
   }
   
   if (!iconInfo) {
@@ -504,17 +500,17 @@ nsIconChannel::InitWithGIO(nsIMozIconURI
   
   // Create a GdkPixbuf buffer containing icon and scale it
   GdkPixbuf* buf = gtk_icon_info_load_icon(iconInfo, NULL);
   gtk_icon_info_free(iconInfo);
   if (!buf) {
     return NS_ERROR_UNEXPECTED;
   }
   
-  rv = ScaleIconBuf(&buf, iconSize);
+  nsresult rv = ScaleIconBuf(&buf, iconSize);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = moz_gdk_pixbuf_to_channel(buf, aIconURI,
                                  getter_AddRefs(mRealChannel));
   g_object_unref(buf);
   return rv;
 }
 #endif // MOZ_ENABLE_GIO