# Compiling to branch table

**URL:** https://discourse.julialang.org/t/compiling-to-branch-table/16599
**Category:** General Usage
**Tags:** question
**Created:** [October 21, 2018, 1:12pm UTC](https://discourse.julialang.org/t/compiling-to-branch-table/16599 "2018-10-21T13:12:54Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)
#### Post date: [October 21, 2018, 3:11pm UTC](https://discourse.julialang.org/t/compiling-to-branch-table/16599/7 "2018-10-21T15:11:12Z")

</div>

Constant propagation works amazingly well in Julia, as I found out when I tried calling `f` from within a function. There’s no need for `StaticNumbers` here. The below is enough.

```julia
const CODES = (2, 3, 5, 7, 11)
const RCODES = reverse(CODES)

f(x) = 0
f(x, y, ys...) = x == y ? 1 + length(ys) : f(x, ys...)
findcode3(x) = f(x, RCODES...)

@code_llvm findcode3(3)

```

---

_[View the full topic](https://discourse.julialang.org/t/compiling-to-branch-table/16599)._
