瀏覽代碼

Just cleaned up some code

Vincent Gee 10 年之前
父節點
當前提交
48ba106667
共有 1 個文件被更改,包括 4 次插入7 次删除
  1. 4 7
      Engine/source/platform/threads/threadPool.cpp

+ 4 - 7
Engine/source/platform/threads/threadPool.cpp

@@ -328,17 +328,14 @@ ThreadPool::ThreadPool( const char* name, U32 numThreads )
       // Use platformCPUInfo directly as in the case of the global pool,
       // Platform::SystemInfo will not yet have been initialized.
       
-      U32 numLogical;
-      U32 numPhysical;
-      U32 numCores;
+      U32 numLogical = 0;
+      U32 numPhysical = 0;
+      U32 numCores = 0;
 
       CPUInfo::CPUCount( numLogical, numCores, numPhysical );
       
       const U32 baseCount = getMax( numLogical, numCores );
-      if( baseCount )
-         mNumThreads = baseCount;
-      else
-         mNumThreads = 2;
+      mNumThreads = (baseCount > 0) ? baseCount : 2;
    }
    
    #ifdef DEBUG_SPEW