aboutsummaryrefslogtreecommitdiffstats
path: root/src/symap.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-09-29 19:25:00 -0400
committerDavid Robillard <d@drobilla.net>2024-10-12 14:07:10 -0400
commit7d0aacb12427a84c8ae9073710045ce4eec4b0f5 (patch)
tree3c09b6ce3e3784225e7ea0c3a037e1004b4a3fc9 /src/symap.c
parent54563d41caf66556978e6ffd37738126499c6e90 (diff)
downloadjalv-7d0aacb12427a84c8ae9073710045ce4eec4b0f5.tar.gz
jalv-7d0aacb12427a84c8ae9073710045ce4eec4b0f5.tar.bz2
jalv-7d0aacb12427a84c8ae9073710045ce4eec4b0f5.zip
Reduce variable scope
Diffstat (limited to 'src/symap.c')
-rw-r--r--src/symap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/symap.c b/src/symap.c
index 07002f2..f75da3b 100644
--- a/src/symap.c
+++ b/src/symap.c
@@ -88,12 +88,11 @@ symap_search(const Symap* const map, const char* const sym, bool* const exact)
uint32_t lower = 0;
uint32_t upper = map->size - 1;
uint32_t i = upper;
- int cmp = 0;
while (upper >= lower) {
- i = lower + ((upper - lower) / 2);
- cmp = strcmp(map->symbols[map->index[i] - 1], sym);
+ i = lower + ((upper - lower) / 2);
+ const int cmp = strcmp(map->symbols[map->index[i] - 1], sym);
if (cmp == 0) {
*exact = true;
return i;