mirror of https://github.com/xzeldon/htop.git
Remove redundant null checks on Settings_write (covscan)
Coverity scan reports that there is dead code in Settings_write checking for nulls that have already been dereferenced on every code path leading to the check. This is likely a hangover from times when the screens pointer was only conditionally allocated - they're not needed anymore.
This commit is contained in:
parent
cb61865bb9
commit
cde72dd0b0
|
@ -631,7 +631,6 @@ int Settings_write(const Settings* this, bool onCrash) {
|
|||
printSettingInteger("tree_view_always_by_pid", this->screens[0]->treeViewAlwaysByPID);
|
||||
printSettingInteger("all_branches_collapsed", this->screens[0]->allBranchesCollapsed);
|
||||
|
||||
if (this->screens && this->screens[0]) {
|
||||
for (unsigned int i = 0; i < this->nScreens; i++) {
|
||||
ScreenSettings* ss = this->screens[i];
|
||||
fprintf(fd, "screen:%s=", ss->name);
|
||||
|
@ -644,7 +643,6 @@ int Settings_write(const Settings* this, bool onCrash) {
|
|||
printSettingInteger(".tree_sort_direction", ss->treeDirection);
|
||||
printSettingInteger(".all_branches_collapsed", ss->allBranchesCollapsed);
|
||||
}
|
||||
}
|
||||
|
||||
#undef printSettingString
|
||||
#undef printSettingInteger
|
||||
|
|
Loading…
Reference in New Issue