about summary refs log tree commit diff stats
path: root/apps/tile/table.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-11-02 19:50:34 -0800
committerKartik Agaram <vc@akkartik.com>2020-11-02 19:50:52 -0800
commita3f779158626b9ad3c81959b85cbfbbce17425fd (patch)
tree10c9da6ee8783a2ed2a3e6e928fb5d70024d1bcc /apps/tile/table.mu
parent951c3f4c92358d3962154a4ef24a19366ea8a619 (diff)
downloadmu-a3f779158626b9ad3c81959b85cbfbbce17425fd.tar.gz
7159 - explicitly use 'return' everywhere
https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 2.
Diffstat (limited to 'apps/tile/table.mu')
-rw-r--r--apps/tile/table.mu4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/tile/table.mu b/apps/tile/table.mu
index 267bed99..a4a2bae6 100644
--- a/apps/tile/table.mu
+++ b/apps/tile/table.mu
@@ -15,10 +15,11 @@ fn bind-in-table _self: (addr table), key: (addr handle array byte), val: (addr
 }
 
 # manual test: full array of binds
-fn next-empty-slot _data: (addr array bind), key: (addr handle array byte) -> result/eax: (offset bind) {
+fn next-empty-slot _data: (addr array bind), key: (addr handle array byte) -> _/eax: (offset bind) {
   var data/esi: (addr array bind) <- copy _data
   var len/ecx: int <- length data
   var i/edx: int <- copy 0
+  var result/eax: (offset bind) <- copy 0
   $next-empty-slot:loop: {
     result <- compute-offset data, i
     compare i, len
@@ -34,6 +35,7 @@ fn next-empty-slot _data: (addr array bind), key: (addr handle array byte) -> re
     i <- increment
     loop
   }
+  return result
 }
 
 fn make-int-binding _self: (addr bind), key: (addr handle array byte), _val: int {