Skip to content

Commit

Permalink
remove loop unrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
erjohnson committed Apr 30, 2024
1 parent 8bf582d commit 3fe1555
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions content/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,38 +397,6 @@ array := [?]int { 10, 20, 30, 40, 50 }
}
```

#### `for` loop unrolling

The `#unroll` directive unrolls a ranged-based `for` loop.

```odin
// Ranges
#unroll for x, i in 1..<4 {
fmt.println(x, i)
}
// Strings
#unroll for r, i in "Hello, unroll" {
fmt.println(r, i)
}
// Arrays
#unroll for elem, idx in ([4]int{1, 4, 9, 16}) {
fmt.println(elem, idx)
}
Foo_Enum :: enum {
A = 1,
B,
C = 6,
D,
}
// Enums
#unroll for elem, idx in Foo_Enum {
fmt.println(elem, idx)
}
```

### `if` statement

Odin's `if` statements do not need to be surrounded by parentheses `( )` but braces `{ }` or `do` are required.
Expand Down

0 comments on commit 3fe1555

Please sign in to comment.