Commit bdb6b2db7bb1d7fc1971736071162c3314b52055

Thomas de Grivel 2024-07-15T10:53:03

binding_get: use temporary variable

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/libc3/binding.c b/libc3/binding.c
index e696643..f08e842 100644
--- a/libc3/binding.c
+++ b/libc3/binding.c
@@ -36,10 +36,12 @@ void binding_delete_all (s_binding *binding)
 
 const s_tag * binding_get (const s_binding *binding, const s_sym *name)
 {
-  while (binding) {
-    if (binding->name == name)
-      return &binding->value;
-    binding = binding->next;
+  const s_binding *b;
+  b = binding;
+  while (b) {
+    if (b->name == name)
+      return &b->value;
+    b = b->next;
   }
   return NULL;
 }