summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-26 18:33:20 +0100
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:59:06 +0200
commit8145ac56d79fd47b9eb31147f91f570bb3669576 (patch)
treee6ce3fd4751a626542021191b72a65b8821fe285 /src
parenta33b748b1610f0d728009ec05c95870fa53c18b7 (diff)
logind: let's reduce one level of indentation
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-session-device.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c
index 65a069012..aac8535ab 100644
--- a/src/login/logind-session-device.c
+++ b/src/login/logind-session-device.c
@@ -459,13 +459,14 @@ void session_device_resume_all(Session *s) {
assert(s);
HASHMAP_FOREACH(sd, s->devices, i) {
- if (!sd->active) {
- if (session_device_start(sd) < 0)
- continue;
- if (session_device_save(sd) < 0)
- continue;
- session_device_notify(sd, SESSION_DEVICE_RESUME);
- }
+ if (sd->active)
+ continue;
+
+ if (session_device_start(sd) < 0)
+ continue;
+ if (session_device_save(sd) < 0)
+ continue;
+ session_device_notify(sd, SESSION_DEVICE_RESUME);
}
}
@@ -476,25 +477,27 @@ void session_device_pause_all(Session *s) {
assert(s);
HASHMAP_FOREACH(sd, s->devices, i) {
- if (sd->active) {
- session_device_stop(sd);
- session_device_notify(sd, SESSION_DEVICE_PAUSE);
- }
+ if (!sd->active)
+ continue;
+
+ session_device_stop(sd);
+ session_device_notify(sd, SESSION_DEVICE_PAUSE);
}
}
unsigned int session_device_try_pause_all(Session *s) {
+ unsigned num_pending = 0;
SessionDevice *sd;
Iterator i;
- unsigned int num_pending = 0;
assert(s);
HASHMAP_FOREACH(sd, s->devices, i) {
- if (sd->active) {
- session_device_notify(sd, SESSION_DEVICE_TRY_PAUSE);
- ++num_pending;
- }
+ if (!sd->active)
+ continue;
+
+ session_device_notify(sd, SESSION_DEVICE_TRY_PAUSE);
+ num_pending++;
}
return num_pending;