aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/input.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/input.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/input.cpp')
-rw-r--r--src/input.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/input.cpp b/src/input.cpp
index 0740a113..efe2f594 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -535,13 +535,12 @@ static bool input_mapping_is_match(const input_mapping_t &m) {
// m.command.c_str());
// We matched the entire sequence.
return true;
- } else {
- int k;
- // Return the read characters.
- input_common_next_ch(c);
- for (k = j - 1; k >= 0; k--) {
- input_common_next_ch(m.seq[k]);
- }
+ }
+
+ // Return the read characters.
+ input_common_next_ch(c);
+ for (int k = j - 1; k >= 0; k--) {
+ input_common_next_ch(m.seq[k]);
}
return false;
@@ -630,12 +629,12 @@ wint_t input_readch(bool allow_commands) {
case R_AND: {
if (input_function_status) {
return input_readch();
- } else {
- while ((c = input_common_readch(0)) && c >= R_MIN && c <= R_MAX)
- ;
- input_common_next_ch(c);
- return input_readch();
}
+ while ((c = input_common_readch(0)) && c >= R_MIN && c <= R_MAX) {
+ // do nothing
+ }
+ input_common_next_ch(c);
+ return input_readch();
}
default: { return c; }
}