diff options
author | Danny Kukawka <danny.kukawka@web.de> | 2009-11-27 10:55:37 +0100 |
---|---|---|
committer | Danny Kukawka <danny.kukawka@web.de> | 2009-11-27 10:55:37 +0100 |
commit | afa1765215303e5dc5f6c8d80b9bf9cf1a969aca (patch) | |
tree | 1f43db27ae6596a1a5fdce130c58fc74352f744b /hald | |
parent | 21a77ced7eec32c9622e84dec1faabbd79e62c73 (diff) |
small performance fix, don't strcasecmp() if result already known
Small performance fix, don't strcasecmp() if result already known,
because we have set a special string.
Diffstat (limited to 'hald')
-rw-r--r-- | hald/linux/device.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hald/linux/device.c b/hald/linux/device.c index 2045e139..2d3800d6 100644 --- a/hald/linux/device.c +++ b/hald/linux/device.c @@ -2854,10 +2854,9 @@ rfkill_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent } type = hal_util_get_string_from_file (sysfs_path, "type"); - if (type == NULL) - type = "unknown"; - - if (strcasecmp (type, "wimax") == 0) { + if (type == NULL) { + hal_device_property_set_string (d, "killswitch.type", "unknown"); + } else if (strcasecmp (type, "wimax") == 0) { hal_device_property_set_string (d, "killswitch.type", "wwan"); } else { hal_device_property_set_string (d, "killswitch.type", type); |