瀏覽代碼

cmCTestMultiProcessHandler: Reduce repeat test property map lookups

Brad King 2 年之前
父節點
當前提交
1487e540aa
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      Source/CTest/cmCTestMultiProcessHandler.cxx

+ 7 - 7
Source/CTest/cmCTestMultiProcessHandler.cxx

@@ -398,21 +398,21 @@ void cmCTestMultiProcessHandler::SetStopTimePassed()
 
 void cmCTestMultiProcessHandler::LockResources(int index)
 {
-  this->LockedResources.insert(
-    this->Properties[index]->LockedResources.begin(),
-    this->Properties[index]->LockedResources.end());
-
-  if (this->Properties[index]->RunSerial) {
+  auto* properties = this->Properties[index];
+  this->LockedResources.insert(properties->LockedResources.begin(),
+                               properties->LockedResources.end());
+  if (properties->RunSerial) {
     this->SerialTestRunning = true;
   }
 }
 
 void cmCTestMultiProcessHandler::UnlockResources(int index)
 {
-  for (std::string const& i : this->Properties[index]->LockedResources) {
+  auto* properties = this->Properties[index];
+  for (std::string const& i : properties->LockedResources) {
     this->LockedResources.erase(i);
   }
-  if (this->Properties[index]->RunSerial) {
+  if (properties->RunSerial) {
     this->SerialTestRunning = false;
   }
 }