summaryrefslogtreecommitdiffstats
path: root/core/subsurface-time.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-13 20:39:49 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-13 16:26:42 -0700
commit2e5913d2ba6c5b5c384121692045be52836ac6fa (patch)
tree07ec2dfc520f30584b47507684b78bb28c4d5c19 /core/subsurface-time.h
parentff6c1a34ad362347e2a3903f3882837d8e455b73 (diff)
downloadsubsurface-2e5913d2ba6c5b5c384121692045be52836ac6fa.tar.gz
core: fix detection of duplicate device names
Recently (c9b8584bd2) the sort criteria of the device-table was changed from (model/id) to (id/model). However, that messed with the detection of duplicate device names: there, the code searched for the first element greater or equal to (model / 0). With the reversal of the sort criteria, this would now always give the first element. Therefore, do a simple non-binary search, which is much more robust. The binary search was a silly and pointless premature optimization anyway - don't do such things if not necessary! Since only one place in the code search for existence for a model-name, fold the corresponding function into that place. Moreover, change the code to do a case-insensitive compare. This is consistent with the dc_match_serial() code in core/libdivecomputer.c, where matching models is case-insensitive! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/subsurface-time.h')
0 files changed, 0 insertions, 0 deletions