vrchat-community / UdonSharp

A compiler for compiling C# to Udon assembly
https://udonsharp.docs.vrchat.com
MIT License
462 stars 50 forks source link

Improve switch flow #102

Open ureishi opened 1 year ago

ureishi commented 1 year ago

Create a dictionary structure (actually two arrays) of tuples (label, address) using the Array class, and change the structure to identify the jump address by IndexOf.

TODO: Sort the dictionary of (label, address) by key if expression type implements IComparable, and also use Array.BinarySearch instead of Array.IndexOf.