[3/3] shlwapi: Avoid a not necessary intermediate variable.

Dmitry Timoshkov dmitry at baikal.ru
Sun Feb 16 23:48:39 CST 2014


---
 dlls/shlwapi/istream.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/dlls/shlwapi/istream.c b/dlls/shlwapi/istream.c
index 2e365d6..bbd331a 100644
--- a/dlls/shlwapi/istream.c
+++ b/dlls/shlwapi/istream.c
@@ -294,16 +294,14 @@ static HRESULT WINAPI IStream_fnLockUnlockRegion(IStream *iface, ULARGE_INTEGER
 static HRESULT WINAPI IStream_fnStat(IStream *iface, STATSTG* lpStat,
                                      DWORD grfStatFlag)
 {
-  ISHFileStream *This = impl_from_IStream(iface);
-  BY_HANDLE_FILE_INFORMATION fi;
-  HRESULT hRet = S_OK;
+    ISHFileStream *This = impl_from_IStream(iface);
+    BY_HANDLE_FILE_INFORMATION fi;
 
-  TRACE("(%p,%p,%d)\n", This, lpStat, grfStatFlag);
+    TRACE("(%p,%p,%d)\n", This, lpStat, grfStatFlag);
+
+    if (!grfStatFlag)
+        return STG_E_INVALIDPOINTER;
 
-  if (!grfStatFlag)
-    hRet = STG_E_INVALIDPOINTER;
-  else
-  {
     memset(&fi, 0, sizeof(fi));
     GetFileInformationByHandle(This->hFile, &fi);
 
@@ -322,8 +320,8 @@ static HRESULT WINAPI IStream_fnStat(IStream *iface, STATSTG* lpStat,
     memcpy(&lpStat->clsid, &IID_IStream, sizeof(CLSID));
     lpStat->grfStateBits = This->grfStateBits;
     lpStat->reserved = 0;
-  }
-  return hRet;
+
+    return S_OK;
 }
 
 /*************************************************************************
-- 
1.8.5.5




More information about the wine-patches mailing list