mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Cleanup: use clear_git_id() instead of setting saved_git_id
For better encapsulation, use clear_git_id() in clear_dive_file_data() instead of setting saved_git_id directly. Thus, memory management of the saved_git_id value is encapsulated and can be modified more easily. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
891d21b34e
commit
ba4d6ae627
2 changed files with 2 additions and 2 deletions
|
@ -1488,7 +1488,7 @@ void clear_dive_file_data()
|
|||
clear_dive(&displayed_dive);
|
||||
|
||||
reset_min_datafile_version();
|
||||
saved_git_id = "";
|
||||
clear_git_id();
|
||||
}
|
||||
|
||||
bool dive_less_than(const struct dive *a, const struct dive *b)
|
||||
|
|
|
@ -1625,7 +1625,7 @@ void clear_git_id(void)
|
|||
saved_git_id = NULL;
|
||||
}
|
||||
|
||||
void set_git_id(const struct git_oid * id)
|
||||
void set_git_id(const struct git_oid *id)
|
||||
{
|
||||
static char git_id_buffer[GIT_OID_HEXSZ + 1];
|
||||
|
||||
|
|
Loading…
Reference in a new issue