[libunwind] r372233 - unwind: remove a could of extraneous `else` (NFC)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 18 09:15:56 PDT 2019


Author: compnerd
Date: Wed Sep 18 09:15:56 2019
New Revision: 372233

URL: http://llvm.org/viewvc/llvm-project?rev=372233&view=rev
Log:
unwind: remove a could of extraneous `else` (NFC)

Simplify `if return else return` by removing the unnecessary `else`.

Modified:
    libunwind/trunk/src/libunwind.cpp

Modified: libunwind/trunk/src/libunwind.cpp
URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/libunwind.cpp?rev=372233&r1=372232&r2=372233&view=diff
==============================================================================
--- libunwind/trunk/src/libunwind.cpp (original)
+++ libunwind/trunk/src/libunwind.cpp Wed Sep 18 09:15:56 2019
@@ -171,8 +171,7 @@ _LIBUNWIND_HIDDEN int __unw_get_proc_inf
   co->getInfo(info);
   if (info->end_ip == 0)
     return UNW_ENOINFO;
-  else
-    return UNW_ESUCCESS;
+  return UNW_ESUCCESS;
 }
 _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_info, unw_get_proc_info)
 
@@ -194,8 +193,7 @@ _LIBUNWIND_HIDDEN int __unw_get_proc_nam
   AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
   if (co->getFunctionName(buf, bufLen, offset))
     return UNW_ESUCCESS;
-  else
-    return UNW_EUNSPEC;
+  return UNW_EUNSPEC;
 }
 _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_name, unw_get_proc_name)
 




More information about the cfe-commits mailing list