mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Desktop: small optimization
This way we don't need to iteratively grow the QVector. Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d0df6a0073
commit
bc4c8d7d74
1 changed files with 1 additions and 0 deletions
|
@ -190,6 +190,7 @@ static void swap(char *&c, QString &q)
|
|||
static QVector<dive *> getDivesForSite(struct dive_site *ds)
|
||||
{
|
||||
QVector<dive *> diveSiteDives;
|
||||
diveSiteDives.reserve(ds->dives.nr);
|
||||
|
||||
for (int i = 0; i < ds->dives.nr; ++i)
|
||||
diveSiteDives.push_back(ds->dives.dives[i]);
|
||||
|
|
Loading…
Reference in a new issue