Skip to content

Commit

Permalink
Generating "else if" where applicable
Browse files Browse the repository at this point in the history
In oneof scenarios, this commit proposes generating "else if" statements where applicable.

The original idea was an attempt to speed up Typescript compilation by reducing the amount of paths Typescript can analyze.
Spoiler alert => nothing changes from that point of view.

Still, the "else if" conditions should slightly speed up the runtime execution,
by avoiding unnecessary checks to the Javascript runtime.
  • Loading branch information
moufmouf committed Nov 26, 2024
1 parent 2dfe112 commit d49e440
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 142 deletions.
30 changes: 10 additions & 20 deletions integration/oneof-unions-snake/google/protobuf/struct.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 16 additions & 20 deletions integration/oneof-unions-value/google/protobuf/struct.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 26 additions & 28 deletions integration/oneof-unions-value/oneof.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 14 additions & 20 deletions integration/oneof-unions/google/protobuf/struct.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 20 additions & 28 deletions integration/oneof-unions/oneof.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d49e440

Please sign in to comment.