Commit eb15a7d
committed
perf: inline getStructNameRange into getStructNameFromType
getStructNameRange searches bounds of type name, but to do this it
returns array of 2 elements: start + end. But as it invoked oftenly this
can create lots of intermediate arrays and waste memory.
This function was inlined into getStructNameFromType and now
substituteStructName just invokes getStructNameFromType and then
'replace' with given typename. This is more optimal, because
substituteStructName invoked more rare that first.1 parent 04289cc commit eb15a7d
1 file changed
+5
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 74 | + | |
81 | 75 | | |
82 | 76 | | |
83 | 77 | | |
| |||
89 | 83 | | |
90 | 84 | | |
91 | 85 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 86 | + | |
| 87 | + | |
105 | 88 | | |
106 | 89 | | |
107 | 90 | | |
| |||
0 commit comments