Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant conditionals and an assignment. #34

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove redudant conditionals and an assignment.
  • Loading branch information
shinji-s committed Aug 2, 2020
commit ee57bdd57ff36a6662306fb105e0fd164a65ee10
17 changes: 6 additions & 11 deletions src/grib_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ int grib_handle_delete(grib_handle* h)

grib_context_log(ct, GRIB_LOG_DEBUG, "grib_handle_delete: deleting handle %p", h);
grib_context_free(ct, h);
h = NULL;
}
return GRIB_SUCCESS;
}
Expand Down Expand Up @@ -1583,16 +1582,12 @@ static grib_multi_support* grib_get_multi_support(grib_context* c, FILE* f)
prev = gm;
gm = gm->next;
}

if (!gm) {
gm = grib_multi_support_new(c);
if (!c->multi_support) {
c->multi_support = gm;
}
else {
if (prev)
prev->next = gm;
}
gm = grib_multi_support_new(c);
if (prev==NULL) { // equivalent to 'if (!c->multi_support)'
c->multi_support = gm;
}
else {
prev->next = gm;
}

gm->next = 0;
Expand Down