[llvm] r230122 - Small cleanup. Don't use else when not needed.

Davide Italiano davide at freebsd.org
Fri Feb 20 18:36:55 PST 2015


Author: davide
Date: Fri Feb 20 20:36:54 2015
New Revision: 230122

URL: http://llvm.org/viewvc/llvm-project?rev=230122&view=rev
Log:
Small cleanup. Don't use else when not needed.
Pointed out by David Majnemer.


Modified:
    llvm/trunk/lib/Support/Unix/Process.inc

Modified: llvm/trunk/lib/Support/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=230122&r1=230121&r2=230122&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Process.inc (original)
+++ llvm/trunk/lib/Support/Unix/Process.inc Fri Feb 20 20:36:54 2015
@@ -106,8 +106,7 @@ size_t Process::GetMallocUsage() {
   sz = sizeof(size_t);
   if (mallctl("stats.allocated", &alloc, &sz, NULL, 0) == 0)
     return alloc;
-  else
-    return 0;
+  return 0;
 #elif defined(HAVE_SBRK)
   // Note this is only an approximation and more closely resembles
   // the value returned by mallinfo in the arena field.
@@ -115,8 +114,7 @@ size_t Process::GetMallocUsage() {
   char *EndOfMemory = (char*)sbrk(0);
   if (EndOfMemory != ((char*)-1) && StartOfMemory != ((char*)-1))
     return EndOfMemory - StartOfMemory;
-  else
-    return 0;
+  return 0;
 #else
 #warning Cannot get malloc info on this platform
   return 0;





More information about the llvm-commits mailing list