Fix else-after-returns throughout pdfium.
[pdfium.git] / core / src / fxge / win32 / fx_win32_dwrite.cpp
index 3cde3bf..65a35d8 100644 (file)
@@ -262,9 +262,7 @@ FX_BOOL     CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, F
 }
 void CDWriteExt::DwDeleteRenderingTarget(void* renderTarget)
 {
-    if (renderTarget) {
-        delete (CDwGdiTextRenderer*)renderTarget;
-    }
+    delete (CDwGdiTextRenderer*)renderTarget;
 }
 void CDWriteExt::DwDeleteFont(void* pFont)
 {
@@ -284,10 +282,9 @@ HRESULT STDMETHODCALLTYPE CDwFontFileStream::QueryInterface(REFIID iid, void** p
         *ppvObject = this;
         AddRef();
         return S_OK;
-    } else {
-        *ppvObject = NULL;
-        return E_NOINTERFACE;
     }
+    *ppvObject = NULL;
+    return E_NOINTERFACE;
 }
 ULONG STDMETHODCALLTYPE CDwFontFileStream::AddRef()
 {
@@ -308,16 +305,14 @@ HRESULT STDMETHODCALLTYPE CDwFontFileStream::ReadFileFragment(
     OUT void** fragmentContext
 )
 {
-    if (fileOffset <= resourceSize_ &&
-            fragmentSize <= resourceSize_ - fileOffset) {
+    if (fileOffset <= resourceSize_ && fragmentSize <= resourceSize_ - fileOffset) {
         *fragmentStart = static_cast<uint8_t const*>(resourcePtr_) + static_cast<size_t>(fileOffset);
         *fragmentContext = NULL;
         return S_OK;
-    } else {
-        *fragmentStart = NULL;
-        *fragmentContext = NULL;
-        return E_FAIL;
     }
+    *fragmentStart = NULL;
+    *fragmentContext = NULL;
+    return E_FAIL;
 }
 void STDMETHODCALLTYPE CDwFontFileStream::ReleaseFileFragment(void* fragmentContext)
 {
@@ -343,10 +338,9 @@ HRESULT STDMETHODCALLTYPE CDwFontFileLoader::QueryInterface(REFIID iid, void** p
         *ppvObject = this;
         AddRef();
         return S_OK;
-    } else {
-        *ppvObject = NULL;
-        return E_NOINTERFACE;
     }
+    *ppvObject = NULL;
+    return E_NOINTERFACE;
 }
 ULONG STDMETHODCALLTYPE CDwFontFileLoader::AddRef()
 {