mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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@xs4all.nl>
This commit is contained in:
parent
88738ede30
commit
76a38b6326
1 changed files with 1 additions and 1 deletions
|
@ -481,7 +481,7 @@ static int find_dive(struct divecomputer *match)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < dive_table.preexisting; i++) {
|
||||
for (i = dive_table.preexisting - 1; i >= 0; i--) {
|
||||
struct dive *old = dive_table.dives[i];
|
||||
|
||||
if (match_one_dive(match, old))
|
||||
|
|
Loading…
Reference in a new issue