diff options
| author | 2018-01-07 15:42:28 +0100 | |
|---|---|---|
| committer | 2018-01-11 06:07:13 +0100 | |
| commit | 6a07ccbad273cdcbea3f984c5c2e9d1b272aae05 (patch) | |
| tree | d389058bb3a66b0cce63331ce325ad34fee6ff22 /core/divecomputer.cpp | |
| parent | e85ecdd9254a8bd222ccb2dfed7d3b3bb96c8294 (diff) | |
| download | subsurface-6a07ccbad273cdcbea3f984c5c2e9d1b272aae05.tar.gz | |
Use helper function empty_string() instead of manual checks
For code consistency, substitute boolean expressions:
s && *s -> !empty_string(s)
s && s[0] -> !empty_string(s)
!s || !*s -> empty_string(s)
!s || !s[0] -> empty_string(s)
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divecomputer.cpp')
| -rw-r--r-- | core/divecomputer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/divecomputer.cpp b/core/divecomputer.cpp index 820a20a51..43219ed05 100644 --- a/core/divecomputer.cpp +++ b/core/divecomputer.cpp @@ -158,7 +158,7 @@ extern "C" void set_dc_nickname(struct dive *dive) struct divecomputer *dc; for_each_dc (dive, dc) { - if (dc->model && *dc->model && dc->deviceid && + if (!empty_string(dc->model) && dc->deviceid && !dcList.getExact(dc->model, dc->deviceid)) { // we don't have this one, yet const DiveComputerNode *existNode = dcList.get(dc->model); |