Use array_lengthof. NFC
[oota-llvm.git] / lib / Support / Windows / RWMutex.inc
index c4318448e7ce99bda0e6d8e7fd023d28a7645814..2d1d25f67b8aa646a009a1efa7588b46128e36a2 100644 (file)
@@ -16,7 +16,7 @@
 //===          is guaranteed to work on *all* Win32 variants.
 //===----------------------------------------------------------------------===//
 
-#include "Windows.h"
+#include "WindowsSupport.h"
 
 namespace llvm {
 using namespace sys;
@@ -84,12 +84,10 @@ RWMutexImpl::RWMutexImpl() {
 }
 
 RWMutexImpl::~RWMutexImpl() {
-  if (sHasSRW) {
-    // Nothing to do in the case of slim reader/writers
-  } else {
+  if (!sHasSRW)
     DeleteCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
-    free(data_);
-  }
+  // Nothing to do in the case of slim reader/writers except free the memory.
+  free(data_);
 }
 
 bool RWMutexImpl::reader_acquire() {