mirror of https://github.com/AxioDL/metaforce.git
hecl/hecl: Assign ResourceLock's good member in the initializer list
Same behavior, but more idiomatic. While we're at it, we can make said constructor and the conversion operator explicit to make the class a little less error-prone.
This commit is contained in:
parent
92b87676c2
commit
eb872cdf88
|
@ -1110,9 +1110,9 @@ class ResourceLock {
|
|||
bool good;
|
||||
|
||||
public:
|
||||
operator bool() const { return good; }
|
||||
explicit operator bool() const { return good; }
|
||||
static bool InProgress(const ProjectPath& path);
|
||||
ResourceLock(const ProjectPath& path) { good = SetThreadRes(path); }
|
||||
explicit ResourceLock(const ProjectPath& path) : good{SetThreadRes(path)} {}
|
||||
~ResourceLock() {
|
||||
if (good)
|
||||
ClearThreadRes();
|
||||
|
|
Loading…
Reference in New Issue