Commit 22b840c2 authored by Shen-Ta Hsieh's avatar Shen-Ta Hsieh Committed by Max Kellermann

win32/Com: use if with init-statement

parent ed1a995b
......@@ -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");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment