diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-05-04 15:19:47 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-05-04 15:32:04 -0700 |
commit | 79f342b954a6f47ee3f1277a899066a654e7c330 (patch) | |
tree | a9386ce1e108a5c046276e4266e0129404fc4ea0 /src/proc.cpp | |
parent | 527e5f52ba5a097a24490065fea23b4627032e4c (diff) |
lint cleanup: eliminate "redundant" errors
This removes some pointless parentheses but the primary focus is removing
redundancies like unnecessary "else" clauses.
Diffstat (limited to 'src/proc.cpp')
-rw-r--r-- | src/proc.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/proc.cpp b/src/proc.cpp index 9bec1811..305be0df 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -175,12 +175,12 @@ job_id_t acquire_job_id(void) { // We found a slot. Note that slot 0 corresponds to job ID 1. *slot = true; return (job_id_t)(slot - consumed_job_ids.begin() + 1); - } else { - // We did not find a slot; create a new slot. The size of the vector is now the job ID - // (since it is one larger than the slot). - consumed_job_ids.push_back(true); - return (job_id_t)consumed_job_ids.size(); } + + // We did not find a slot; create a new slot. The size of the vector is now the job ID + // (since it is one larger than the slot). + consumed_job_ids.push_back(true); + return (job_id_t)consumed_job_ids.size(); } void release_job_id(job_id_t jid) { @@ -368,14 +368,14 @@ process_t::process_t() } process_t::~process_t() { - if (this->next != NULL) delete this->next; + delete this->next; } job_t::job_t(job_id_t jobid, const io_chain_t &bio) : block_io(bio), first_process(NULL), pgid(0), tmodes(), job_id(jobid), flags(0) {} job_t::~job_t() { - if (first_process != NULL) delete first_process; + delete first_process; release_job_id(job_id); } @@ -451,10 +451,9 @@ static int process_mark_finished_children(bool wants_await) { if (got_error) { return -1; - } else { - s_last_processed_sigchld_generation_count = local_count; - return processed_count; } + s_last_processed_sigchld_generation_count = local_count; + return processed_count; } /// This is called from a signal handler. The signal is always SIGCHLD. |