aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/env_universal_common.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/env_universal_common.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/env_universal_common.cpp')
-rw-r--r--src/env_universal_common.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/env_universal_common.cpp b/src/env_universal_common.cpp
index fc78a1ce..bb5b759b 100644
--- a/src/env_universal_common.cpp
+++ b/src/env_universal_common.cpp
@@ -85,7 +85,10 @@ static wcstring vars_filename_in_directory(const wcstring &wdir) {
}
static const wcstring &default_vars_path() {
- static wcstring cached_result = vars_filename_in_directory(fishd_get_config());
+ // Oclint complains about this being a "redundant local variable"; however it isn't because the
+ // assignment to a static var is needed to keep the object from being deleted when this function
+ // returns.
+ static wcstring cached_result = vars_filename_in_directory(fishd_get_config()); //!OCLINT
return cached_result;
}
@@ -1121,9 +1124,8 @@ class universal_notifier_shmem_poller_t : public universal_notifier_t {
unsigned long usec_per_sec = 1000000;
if (get_time() - last_change_time < 5LL * usec_per_sec) {
return usec_per_sec / 10; // 10 times a second
- } else {
- return usec_per_sec / 3; // 3 times a second
}
+ return usec_per_sec / 3; // 3 times a second
}
};
@@ -1287,10 +1289,9 @@ class universal_notifier_named_pipe_t : public universal_notifier_t {
// We are in polling mode because we think our fd is readable. This means that, if we
// return it to be select()'d on, we'll be called back immediately. So don't return it.
return -1;
- } else {
- // We are not in polling mode. Return the fd so it can be watched.
- return pipe_fd;
}
+ // We are not in polling mode. Return the fd so it can be watched.
+ return pipe_fd;
}
bool notification_fd_became_readable(int fd) {