瀏覽代碼

Syntax seemed to be confusing according to the Bill

Sebastien Barre 24 年之前
父節點
當前提交
41bd8eff90
共有 1 個文件被更改,包括 8 次插入10 次删除
  1. 8 10
      Source/cmSystemTools.cxx

+ 8 - 10
Source/cmSystemTools.cxx

@@ -346,17 +346,15 @@ bool cmSystemTools::WriteRegistryValue(const char *key, const char *value)
     {
     return false;
     }
-  else
+
+  if(RegSetValueEx(hKey, 
+                   (LPTSTR)valuename.c_str(), 
+                   0, 
+                   REG_SZ, 
+                   (CONST BYTE *)value, 
+                   (DWORD)(strlen(value) + 1)) == ERROR_SUCCESS)
     {
-    if(RegSetValueEx(hKey, 
-                     (LPTSTR)valuename.c_str(), 
-                     0, 
-                     REG_SZ, 
-                     (CONST BYTE *)value, 
-                     (DWORD)(strlen(value) + 1)) == ERROR_SUCCESS)
-      {
-      return true;
-      }
+    return true;
     }
 #endif
   return false;