summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-08 03:01:05 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-08 03:01:05 +0200
commita90ebccc072efa17313fe68c737b3507247c37dd (patch)
treef469f3392e84991816b949d27d07a2f744379d16 /device.c
parent37d88da701d75a3893b262580dc59042147a9b89 (diff)
unit: shortcut unit_notify() early, if possible
Diffstat (limited to 'device.c')
-rw-r--r--device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/device.c b/device.c
index 25661e05f8..d99038f77e 100644
--- a/device.c
+++ b/device.c
@@ -49,6 +49,9 @@ static void device_set_state(Device *d, DeviceState state) {
DeviceState old_state;
assert(d);
+ if (state == d->state)
+ return;
+
old_state = d->state;
d->state = state;