1
0
Fork 0
forked from len0rd/rockbox

hwstub/regtools/qeditor: put soc descriptors in a list instead of a vector

A SoC descriptor is not a small object: it can be as large as ~100KiB so
it's better to avoid copying things over.

Change-Id: I1ef862e1260299cdaa0c4d2822ac45968713498a
This commit is contained in:
Amaury Pouly 2014-02-09 02:07:33 +01:00
parent 1f4f7369ee
commit 8358707d82
4 changed files with 18 additions and 17 deletions

View file

@ -14,17 +14,17 @@ Backend::Backend()
QStringList Backend::GetSocNameList()
{
QStringList sl;
for(size_t i = 0; i < m_socs.size(); i++)
sl.append(QString(m_socs[i].name.c_str()));
foreach(const soc_t& soc, m_socs)
sl.append(QString(soc.name.c_str()));
return sl;
}
bool Backend::GetSocByName(const QString& name, soc_t& s)
{
for(size_t i = 0; i < m_socs.size(); i++)
if(m_socs[i].name == name.toStdString())
for(std::list< soc_t >::iterator it = m_socs.begin(); it != m_socs.end(); ++it)
if(it->name == name.toStdString())
{
s = m_socs[i];
s = *it;
return true;
}
return false;