aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parse_execution.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-05-04 15:19:47 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-05-04 15:32:04 -0700
commit79f342b954a6f47ee3f1277a899066a654e7c330 (patch)
treea9386ce1e108a5c046276e4266e0129404fc4ea0 /src/parse_execution.cpp
parent527e5f52ba5a097a24490065fea23b4627032e4c (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/parse_execution.cpp')
-rw-r--r--src/parse_execution.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp
index a553f4cb..13e49924 100644
--- a/src/parse_execution.cpp
+++ b/src/parse_execution.cpp
@@ -213,16 +213,18 @@ parse_execution_context_t::execution_cancellation_reason_t
parse_execution_context_t::cancellation_reason(const block_t *block) const {
if (shell_is_exiting()) {
return execution_cancellation_exit;
- } else if (parser && parser->cancellation_requested) {
+ }
+ if (parser && parser->cancellation_requested) {
return execution_cancellation_skip;
- } else if (block && block->loop_status != LOOP_NORMAL) {
+ }
+ if (block && block->loop_status != LOOP_NORMAL) {
// Nasty hack - break and continue set the 'skip' flag as well as the loop status flag.
return execution_cancellation_loop_control;
- } else if (block && block->skip) {
+ }
+ if (block && block->skip) {
return execution_cancellation_skip;
- } else {
- return execution_cancellation_none;
}
+ return execution_cancellation_none;
}
/// Return whether the job contains a single statement, of block type, with no redirections.
@@ -1042,10 +1044,9 @@ parse_execution_result_t parse_execution_context_t::populate_boolean_process(
if (skip_job) {
return parse_execution_skipped;
- } else {
- const parse_node_t &subject = *tree.get_child(bool_statement, 1, symbol_statement);
- return this->populate_job_process(job, proc, subject);
}
+ const parse_node_t &subject = *tree.get_child(bool_statement, 1, symbol_statement);
+ return this->populate_job_process(job, proc, subject);
}
parse_execution_result_t parse_execution_context_t::populate_block_process(