QCoffPeParser: simplify std::optional check
Even in C++98 one could declare variables in if statements and
contextually convert them to bool:
if (D* d = dynamic_cast<D*>(base))
~~~
else if (D2* d = dynamic_cast<D2*>(base))
~~~
std::optional is contextually convertible to bool, so we don't need
C++17 if initializers. Just use
if (auto optional = ~~~~)
Pick-to: 6.3
Change-Id: Ie64c2c1ceb7b608eda0534d837f46d3c4be49bf8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
parent
0d9f4e7526
commit
472722382d
|
|
@ -364,7 +364,7 @@ QLibraryScanResult QCoffPeParser::parse(QByteArrayView data, QString *errMsg)
|
|||
return {};
|
||||
|
||||
QByteArrayView stringTable;
|
||||
if (auto optional = findStringTable(data, ntHeaders, error); optional)
|
||||
if (auto optional = findStringTable(data, ntHeaders, error))
|
||||
stringTable = *optional;
|
||||
else
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue