Prefer make_unique over new

This commit is contained in:
tcoyvwac 2021-10-14 01:16:10 +02:00
parent 1e630fc584
commit ba0c09e082
No known key found for this signature in database
GPG Key ID: 88BAEF34B4B127DC
2 changed files with 2 additions and 2 deletions

View File

@ -991,7 +991,7 @@ void CHC::resetSourceAnalysis()
if (usesZ3) if (usesZ3)
{ {
/// z3::fixedpoint does not have a reset mechanism, so we need to create another. /// z3::fixedpoint does not have a reset mechanism, so we need to create another.
m_interface.reset(new Z3CHCInterface(m_settings.timeout)); m_interface = std::make_unique<Z3CHCInterface>(m_settings.timeout);
auto z3Interface = dynamic_cast<Z3CHCInterface const*>(m_interface.get()); auto z3Interface = dynamic_cast<Z3CHCInterface const*>(m_interface.get());
solAssert(z3Interface, ""); solAssert(z3Interface, "");
m_context.setSolver(z3Interface->z3Interface()); m_context.setSolver(z3Interface->z3Interface());

View File

@ -533,7 +533,7 @@ void SourceUpgrade::resetCompiler()
void SourceUpgrade::resetCompiler(ReadCallback::Callback const& _callback) void SourceUpgrade::resetCompiler(ReadCallback::Callback const& _callback)
{ {
m_compiler.reset(new CompilerStack(_callback)); m_compiler = std::make_unique<CompilerStack>(_callback);
m_compiler->setSources(m_sourceCodes); m_compiler->setSources(m_sourceCodes);
m_compiler->setParserErrorRecovery(true); m_compiler->setParserErrorRecovery(true);
} }