-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Command argument parsing improvements (#255)
* Add internal ArgSlice.FromPinnedSpan * Simplify paths where WriteIntegerFromBytes is used * We can avoid allocating intermediary arrays and extra fixing now * Avoid ASCII re-encoding and string allocation in ReadDoubleWithLengthHeader * Remove unused ReadPtrArrayWithLengthHeader * Remove unused ReadArrayWithLengthHeader * Avoid ASCII re-encoding and string allocation in more places * Also few other nits for speed * Use StringComparison.OrdinalIgnoreCase instead of ToUpper where appropiate * Avoid string allocation & avoid current thread culture lookup for equals * Switched some ToUpper to ToUpperInvariant too * ToLower -> ToLowerInvariant * Avoid CurrentCulture lookup * Use Enum.TryParse instead of paying the cost exception * Also switch over to generic overloads, allows JIT to see what type is used * dotnet-format * Revert BitmapCommand Parse overload changes * We completely spanify these later, the calls got ugly * Update BitmapCommands.cs Missed one. * dotnet-format * Thanks github web editor * Update libs/cluster/Session/ClusterCommands.cs * FromFixedSpan -> FromPinnedSpan * Add import lost in merge * Apply suggestions from code review * Remove regex from ACLParser * Use string.Equals in ACLParser * Make cluster node id comparisons use StringComparison.Ordinal * instead of CurrentCulture * Move more exact comparisons over to StringComparison.Ordinal * Remove partial from ACLParser * Leftover when I tested Regex source-gen but it's overkill here * Fix floating point formatting for cultures with different decimal seperator All tests finally pass for fi-FI * Fix floating point formatting for cultures with different decimal seperator * couple more * Fix double.TryParse overload for .NET 6 * Use Enum.TryParse instead of exception handling in InfoCommand * Fix merge * Remove unnecessary case insensitive comparisons * StringComparison.Ordinal gets unrolled by JIT * Remove empty entries from tokenized ACL rule input * Make ACL op keywords case insensitive per the PR feedback * Check that Utf8Parser.TryParse consumes entire input * Misc. adjustments * Comparisons strings to uppercase * Formatting adjustments * Few unnecessary using directives in the files which PR touches * Fix public field casing in Worker.cs * Make Cluster node id comparisons case insensitive * Make local node getters properties * Makes it clear that the methods don't do extra "work" * dotnet format --------- Co-authored-by: Badrish Chandramouli <badrishc@microsoft.com> Co-authored-by: Lukas Maas <lumaas@microsoft.com> Co-authored-by: vazois <96085550+vazois@users.noreply.github.com>
- Loading branch information
1 parent
515b6c1
commit 03611e1
Showing
59 changed files
with
530 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.