aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysmo_sock.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-13 11:52:50 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-27 22:14:45 +0200
commit51c57045e533caaa51ca5acf8929628c21dd6b94 (patch)
tree4939868db25401166dc665c9e4c1441153af35ce /src/sysmo_sock.cpp
parenta004e6a8233695abd417a97d6f81a802b605038a (diff)
misc: Remove if (timer_pending) stop_timer idiom from the code
osmo_timer_del is an idempotent operation. There is no requirement to check if it is running. If you don't want a timer to run, delete it. Maybe one should have called the method _unschedule, _cancel to make this more clear.
Diffstat (limited to 'src/sysmo_sock.cpp')
-rw-r--r--src/sysmo_sock.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sysmo_sock.cpp b/src/sysmo_sock.cpp
index a4cc6ded..d4fb5a6c 100644
--- a/src/sysmo_sock.cpp
+++ b/src/sysmo_sock.cpp
@@ -304,8 +304,7 @@ void pcu_l1if_close(void)
if (!state)
return;
- if (osmo_timer_pending(&state->timer))
- osmo_timer_del(&state->timer);
+ osmo_timer_del(&state->timer);
bfd = &state->conn_bfd;
if (bfd->fd > 0)