2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-03 10:35:51 +00:00

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:
Lioncash 2019-08-15 02:10:49 -04:00
parent 92b87676c2
commit eb872cdf88

View File

@ -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();