Commit 97011f7
Use ReadOnlySpan<char> to avoid string allocations in attribute name matching
- Use MemoryExtensions.AsSpan() to work with ReadOnlySpan<char> instead of allocating substring
- Use MemoryExtensions.SequenceEqual() for span comparison
- Add using System for MemoryExtensions
- Reduces memory allocations when checking attribute names with parameters (e.g., @Bind:after)
All tests pass (9/9 passing).
Co-authored-by: DustinCampbell <[email protected]>1 parent 03b62c1 commit 97011f7
File tree
1 file changed
+5
-4
lines changed- src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/Razor
1 file changed
+5
-4
lines changedLines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
103 | | - | |
| 103 | + | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | | - | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
0 commit comments