Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/plugins/ r?jimm
MozReview-Commit-ID: Bp1M9LW77Ia
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -2269,19 +2269,17 @@ NPError
#ifndef MOZ_WIDGET_ANDROID
// On android, their 'drawing model' uses the same constant!
case NPPVpluginDrawingModel: {
if (inst) {
inst->SetDrawingModel((NPDrawingModel)NS_PTR_TO_INT32(result));
return NPERR_NO_ERROR;
}
- else {
- return NPERR_GENERIC_ERROR;
- }
+ return NPERR_GENERIC_ERROR;
}
#endif
#ifdef XP_MACOSX
case NPPVpluginEventModel: {
if (inst) {
inst->SetEventModel((NPEventModel)NS_PTR_TO_INT32(result));
return NPERR_NO_ERROR;
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -181,23 +181,20 @@ busy_beaver_PR_Read(PRFileDesc *fd, void
n = PR_Read(fd, start, remaining);
if (n < 0)
{
/* may want to repeat if errno == EINTR */
if( (len - remaining) == 0 ) // no octet is ever read
return -1;
break;
}
- else
- {
- remaining -= n;
- char *cp = (char *) start;
- cp += n;
- start = cp;
- }
+ remaining -= n;
+ char *cp = (char *) start;
+ cp += n;
+ start = cp;
}
return len - remaining;
}
NS_IMPL_ISUPPORTS0(nsInvalidPluginTag)
nsInvalidPluginTag::nsInvalidPluginTag(const char* aFullPath, int64_t aLastModifiedTime)
: mFullPath(aFullPath),
@@ -2843,18 +2840,18 @@ nsPluginHost::ReadPluginInfo()
if (!mPluginRegFile) {
// There is no profile yet, this will tell us if there is going to be one
// in the future.
directoryService->Get(NS_APP_PROFILE_DIR_STARTUP, NS_GET_IID(nsIFile),
getter_AddRefs(mPluginRegFile));
if (!mPluginRegFile)
return NS_ERROR_FAILURE;
- else
- return NS_ERROR_NOT_AVAILABLE;
+
+ return NS_ERROR_NOT_AVAILABLE;
}
PRFileDesc* fd = nullptr;
nsCOMPtr<nsIFile> pluginReg;
rv = mPluginRegFile->Clone(getter_AddRefs(pluginReg));
if (NS_FAILED(rv))
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -1110,20 +1110,19 @@ NPError
return NPERR_NO_ERROR;
case NPNVSupportsWindowless:
*(NPBool*)aValue = PluginModuleChild::GetChrome()->Settings().supportsWindowless();
return NPERR_NO_ERROR;
#if defined(MOZ_WIDGET_GTK)
case NPNVxDisplay: {
if (aNPP) {
return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
- }
- else {
- *(void **)aValue = xt_client_get_display();
- }
+ }
+ *(void
+ **)aValue = xt_client_get_display();
return NPERR_NO_ERROR;
}
case NPNVxtAppContext:
return NPERR_GENERIC_ERROR;
#endif
default: {
if (aNPP) {
return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);