diff options
author | David Robillard <d@drobilla.net> | 2022-12-10 16:45:27 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-12-10 19:04:45 -0500 |
commit | 3f209ff081bbcf0f15a3acfcb04b3371011f9f9d (patch) | |
tree | dfab914254be05df6e4738713bbd50b671f86b57 /test | |
parent | d4dff3e6e9ea3c96d77c9b8f532dec070bdab850 (diff) | |
download | lilv-3f209ff081bbcf0f15a3acfcb04b3371011f9f9d.tar.gz lilv-3f209ff081bbcf0f15a3acfcb04b3371011f9f9d.tar.bz2 lilv-3f209ff081bbcf0f15a3acfcb04b3371011f9f9d.zip |
Simplify trivial switch statements
Diffstat (limited to 'test')
-rw-r--r-- | test/lib_descriptor.lv2/lib_descriptor.c | 7 | ||||
-rw-r--r-- | test/test_plugin.lv2/test_plugin.c | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/test/lib_descriptor.lv2/lib_descriptor.c b/test/lib_descriptor.lv2/lib_descriptor.c index 652ba8f..bae1659 100644 --- a/test/lib_descriptor.lv2/lib_descriptor.c +++ b/test/lib_descriptor.lv2/lib_descriptor.c @@ -82,12 +82,7 @@ get_plugin(LV2_Lib_Handle handle, uint32_t index) { (void)handle; - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } + return index ? NULL : &descriptor; } static const LV2_Lib_Descriptor lib = {NULL, diff --git a/test/test_plugin.lv2/test_plugin.c b/test/test_plugin.lv2/test_plugin.c index 582fd9b..d2906d6 100644 --- a/test/test_plugin.lv2/test_plugin.c +++ b/test/test_plugin.lv2/test_plugin.c @@ -458,10 +458,5 @@ LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } + return index ? NULL : &descriptor; } |