tweaks: invert a condition, to get an early return instead of indentation
parent
7e807cdd2f
commit
99607a5bbe
|
@ -469,21 +469,21 @@ void save_poshistory(void)
|
||||||
/* Reload the position history file if it has been modified since last load. */
|
/* Reload the position history file if it has been modified since last load. */
|
||||||
void reload_positions_if_needed(void)
|
void reload_positions_if_needed(void)
|
||||||
{
|
{
|
||||||
|
poshiststruct *item, *nextone;
|
||||||
struct stat fileinfo;
|
struct stat fileinfo;
|
||||||
|
|
||||||
if (stat(poshistname, &fileinfo) == 0 && fileinfo.st_mtime != latest_timestamp) {
|
if (stat(poshistname, &fileinfo) != 0 || fileinfo.st_mtime == latest_timestamp)
|
||||||
poshiststruct *item, *nextone;
|
return;
|
||||||
|
|
||||||
for (item = position_history; item != NULL; item = nextone) {
|
for (item = position_history; item != NULL; item = nextone) {
|
||||||
nextone = item->next;
|
nextone = item->next;
|
||||||
free(item->filename);
|
free(item->filename);
|
||||||
free(item);
|
free(item);
|
||||||
}
|
|
||||||
|
|
||||||
position_history = NULL;
|
|
||||||
|
|
||||||
load_poshistory();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
position_history = NULL;
|
||||||
|
|
||||||
|
load_poshistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the recorded last file positions with the current position in the
|
/* Update the recorded last file positions with the current position in the
|
||||||
|
|
Loading…
Reference in New Issue