summaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-31 14:07:31 +0100
committerDavid Robillard <d@drobilla.net>2020-12-31 14:07:31 +0100
commit7a51f0b8e95d29b5e053db97bf72094e847ee7ef (patch)
tree388ce4b62ee033777125370be4105c5b8aa8b2df /src/state.c
parenta5a72832c05ba2894d90def0b74128a93dcca937 (diff)
downloadlilv-7a51f0b8e95d29b5e053db97bf72094e847ee7ef.tar.gz
lilv-7a51f0b8e95d29b5e053db97bf72094e847ee7ef.tar.bz2
lilv-7a51f0b8e95d29b5e053db97bf72094e847ee7ef.zip
Avoid "else" after "return"
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/state.c b/src/state.c
index fed7b18..f30cfd4 100644
--- a/src/state.c
+++ b/src/state.c
@@ -100,7 +100,9 @@ property_cmp(const void* a, const void* b)
if (a_key < b_key) {
return -1;
- } else if (b_key < a_key) {
+ }
+
+ if (b_key < a_key) {
return 1;
}
@@ -270,12 +272,16 @@ abstract_path(LV2_State_Map_Path_Handle handle,
if (abs_path[0] == '\0') {
return lilv_strdup(abs_path);
- } else if (!zix_tree_find(state->abs2rel, &key, &iter)) {
+ }
+
+ if (!zix_tree_find(state->abs2rel, &key, &iter)) {
// Already mapped path in a previous call
PathMap* pm = (PathMap*)zix_tree_get(iter);
free(real_path);
return lilv_strdup(pm->rel);
- } else if (lilv_path_is_child(real_path, state->dir)) {
+ }
+
+ if (lilv_path_is_child(real_path, state->dir)) {
// File in state directory (loaded, or created by plugin during save)
path = lilv_path_relative_to(real_path, state->dir);
} else if (lilv_path_is_child(real_path, state->scratch_dir)) {
@@ -1460,7 +1466,9 @@ lilv_state_equals(const LilvState* a, const LilvState* b)
|| ap->type != bp->type
|| ap->flags != bp->flags) {
return false;
- } else if (ap->type == a->atom_Path) {
+ }
+
+ if (ap->type == a->atom_Path) {
if (!lilv_file_equals(lilv_state_rel2abs(a, (char*)ap->value),
lilv_state_rel2abs(b, (char*)bp->value))) {
return false;