win32/Com: use if with init-statement

This commit is contained in:
Shen-Ta Hsieh 2021-03-04 18:37:22 +01:00 committed by Max Kellermann
parent ed1a995bff
commit 22b840c2f1

View File

@ -29,8 +29,8 @@
class COM {
public:
COM() {
HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (FAILED(result)) {
if (HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
FAILED(result)) {
throw FormatHResultError(result, "Unable to initialize COM");
}
}