Changeset 76a38b6 in subsurface


Ignore:
Timestamp:
May 29, 2017, 8:57:04 AM (4 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
57d0170
Parents:
88738ede
git-author:
Jan Mulder <jlmulder@…> (05/28/17 12:25:44)
git-committer:
Dirk Hohndel <dirk@…> (05/29/17 08:57:04)
Message:

More optimal search

The linear search to determine that a just downloaded dive was already
downloaded, started from the oldest dive in the logbook. It is, however
more likely that a just downloaded dive is one of the most recently
downloaded. So, just search backwards. Just a trivial performance
improvement.

Signed-off-by: Jan Mulder <jlmulder@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/libdivecomputer.c

    r6399eaf r76a38b6  
    482482        int i;
    483483
    484         for (i = 0; i < dive_table.preexisting; i++) {
     484        for (i = dive_table.preexisting - 1; i >= 0; i--) {
    485485                struct dive *old = dive_table.dives[i];
    486486
Note: See TracChangeset for help on using the changeset viewer.