Skip to content

Commit

Permalink
perf: short circuit end of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
susisu committed Apr 14, 2024
1 parent 060cb65 commit ec11cac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ type NextProc<P, M, I, O, R> =
: C extends "[" ?
Read<M> extends "\x00" ?
State<Q, M, I, O, R, [unknown]>
: State<Q, M, I, O, Cons<P, R>, []>
: State<Q, M, I, O, Cons<Q, R>, []>
: C extends "]" ?
R extends [] ?
never
: State<Head<R>, M, I, O, Tail<R>, []>
R extends [] ? never
: Read<M> extends "\x00" ? State<Q, M, I, O, Tail<R>, []>
: State<Head<R>, M, I, O, R, []>
: State<Q, M, I, O, R, []>
: never;

Expand Down

0 comments on commit ec11cac

Please sign in to comment.