Address items from review

This commit is contained in:
Adam Saponara
2020-10-31 20:36:53 -04:00
parent dde71c6637
commit a83f515f0f
5 changed files with 16 additions and 11 deletions

View File

@ -6,7 +6,6 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep
#include "Process.h"
@ -383,10 +382,10 @@ void Process_display(const Object* cast, RichString* out) {
if (this->tag == true)
RichString_setAttr(out, CRT_colors[PROCESS_TAG]);
if (this->settings->highlightChanges) {
if (Process_isNew(this))
out->highlightAttr = CRT_colors[PROCESS_NEW];
if (Process_isTomb(this))
out->highlightAttr = CRT_colors[PROCESS_TOMB];
else if (Process_isNew(this))
out->highlightAttr = CRT_colors[PROCESS_NEW];
}
assert(out->chlen > 0);
}
@ -421,13 +420,14 @@ void Process_toggleTag(Process* this) {
}
bool Process_isNew(const Process* this) {
if (this->processList && this->processList->scanTs >= this->seenTs)
return (this->processList->scanTs - this->seenTs <= this->processList->settings->highlightDelaySecs);
assert(this->processList);
if (this->processList->scanTs >= this->seenTs)
return this->processList->scanTs - this->seenTs <= this->processList->settings->highlightDelaySecs;
return false;
}
bool Process_isTomb(const Process* this) {
return (this->tombTs > 0);
return this->tombTs > 0;
}
bool Process_setPriority(Process* this, int priority) {