mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 03:48:02 +08:00
source: Pass cmCTestResourceAllocator::Resource by value
This commit is contained in:

committed by
Brad King

parent
ee1c32b6d7
commit
964e992ec5
@@ -72,15 +72,3 @@ bool cmCTestResourceAllocator::DeallocateResource(std::string const& name,
|
||||
resIt->second.Locked -= slots;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cmCTestResourceAllocator::Resource::operator==(
|
||||
Resource const& other) const
|
||||
{
|
||||
return this->Total == other.Total && this->Locked == other.Locked;
|
||||
}
|
||||
|
||||
bool cmCTestResourceAllocator::Resource::operator!=(
|
||||
Resource const& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
@@ -17,8 +17,15 @@ public:
|
||||
|
||||
unsigned int Free() const { return this->Total - this->Locked; }
|
||||
|
||||
bool operator==(Resource const& other) const;
|
||||
bool operator!=(Resource const& other) const;
|
||||
friend bool operator==(Resource left, Resource right)
|
||||
{
|
||||
return left.Total == right.Total && left.Locked == right.Locked;
|
||||
}
|
||||
|
||||
friend bool operator!=(Resource left, Resource right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
};
|
||||
|
||||
void InitializeFromResourceSpec(cmCTestResourceSpec const& spec);
|
||||
|
Reference in New Issue
Block a user