mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
e85ecdd925
commit
6a07ccbad2
8 changed files with 11 additions and 11 deletions
|
@ -1088,11 +1088,11 @@ static void create_commit_message(struct membuffer *msg, bool create_empty)
|
|||
nr = dive->number;
|
||||
|
||||
put_format(msg, "dive %d: %s", nr, location);
|
||||
if (trip && trip->location && *trip->location && strcmp(trip->location, location))
|
||||
if (trip && !empty_string(trip->location) && strcmp(trip->location, location))
|
||||
put_format(msg, " (%s)", trip->location);
|
||||
put_format(msg, "\n");
|
||||
do {
|
||||
if (dc->model && *dc->model) {
|
||||
if (!empty_string(dc->model)) {
|
||||
put_format(msg, "%s%s", sep, dc->model);
|
||||
sep = ", ";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue