Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
path/filepath: optimize isReservedName
A linear search through a list of 22 strings takes ~80ns. A quick check for 3-4 byte strings reduces this check to 2ns for a vast majority of inputs. In the event of a name match, the new logic is either just as fast (for "CON") or 10x faster (for "LPT9"). Change-Id: I412fa73beebd7c81dc95f9ed12c35ca1d5d6baf0 Reviewed-on: https://go-review.googlesource.com/c/go/+/433175 Reviewed-by: Damien Neil <[email protected]> Run-TryBot: Joseph Tsai <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Joseph Tsai <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
- Loading branch information