Core: remove preexisting field from struct dive_table

Dives are now in all cases imported via distinct dive_tables.
Therefore the "preexisting" marker is useless. Remove.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-10-03 21:14:11 +02:00 committed by Dirk Hohndel
parent 810903bdb9
commit ab14889563
6 changed files with 2 additions and 7 deletions

View file

@ -431,7 +431,7 @@ extern const struct units *get_units(void);
extern int run_survey, verbose, quit, force_root;
struct dive_table {
int nr, allocated, preexisting;
int nr, allocated;
struct dive **dives;
};

View file

@ -77,7 +77,6 @@ void DownloadThread::run()
#endif
qDebug() << "Starting download from " << (internalData->bluetooth_mode ? "BT" : internalData->devname);
downloadTable.nr = 0;
dive_table.preexisting = dive_table.nr;
Q_ASSERT(internalData->download_table != nullptr);
const char *errorText;

View file

@ -503,7 +503,7 @@ static int find_dive(struct divecomputer *match)
{
int i;
for (i = dive_table.preexisting - 1; i >= 0; i--) {
for (i = dive_table.nr - 1; i >= 0; i--) {
struct dive *old = dive_table.dives[i];
if (match_one_dive(match, old))