forked from qt-creator/qt-creator
Utils: Change std::shared_ptr to std::unique_ptr
Its not necessary to use shared_ptr here, unique_ptr is enough. Change-Id: Ib30dce40054ae8f383674e2e70759e3c30710510 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -283,9 +283,9 @@ ElfReader::Result ElfReader::readIt()
|
|||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ElfMapper> ElfReader::readSection(const QByteArray &name)
|
std::unique_ptr<ElfMapper> ElfReader::readSection(const QByteArray &name)
|
||||||
{
|
{
|
||||||
std::shared_ptr<ElfMapper> mapper;
|
std::unique_ptr<ElfMapper> mapper;
|
||||||
readIt();
|
readIt();
|
||||||
int i = m_elfData.indexOf(name);
|
int i = m_elfData.indexOf(name);
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
|
@@ -140,7 +140,7 @@ public:
|
|||||||
enum Result { Ok, NotElf, Corrupt };
|
enum Result { Ok, NotElf, Corrupt };
|
||||||
|
|
||||||
ElfData readHeaders();
|
ElfData readHeaders();
|
||||||
std::shared_ptr<ElfMapper> readSection(const QByteArray §ionName);
|
std::unique_ptr<ElfMapper> readSection(const QByteArray §ionName);
|
||||||
QString errorString() const { return m_errorString; }
|
QString errorString() const { return m_errorString; }
|
||||||
QByteArray readCoreName(bool *isCore);
|
QByteArray readCoreName(bool *isCore);
|
||||||
|
|
||||||
|
@@ -3130,7 +3130,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
|
|||||||
}
|
}
|
||||||
if (globalRegExpSourceMap.isEmpty())
|
if (globalRegExpSourceMap.isEmpty())
|
||||||
return;
|
return;
|
||||||
if (std::shared_ptr<ElfMapper> mapper = reader.readSection(".debug_str")) {
|
if (std::unique_ptr<ElfMapper> mapper = reader.readSection(".debug_str")) {
|
||||||
const char *str = mapper->start;
|
const char *str = mapper->start;
|
||||||
const char *limit = str + mapper->fdlen;
|
const char *limit = str + mapper->fdlen;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
Reference in New Issue
Block a user