perf: preallocate options map in drawRulerFile (#2469)
This commit is contained in:
1 parent
2e724a98db
commit
6d5b9f924e
1 file changed
+1
-1
@@ -952,9 +952,9 @@ func (ui *ui) drawRulerFile(nav *nav) {
|
|||||||
mode = "VISUAL"
|
mode = "VISUAL"
|
||||||
}
|
}
|
||||||
|
|
||||||
options := make(map[string]string)
|
|
||||||
v := reflect.ValueOf(gOpts)
|
v := reflect.ValueOf(gOpts)
|
||||||
t := v.Type()
|
t := v.Type()
|
||||||
|
options := make(map[string]string, v.NumField())
|
||||||
for i := range v.NumField() {
|
for i := range v.NumField() {
|
||||||
name := t.Field(i).Name
|
name := t.Field(i).Name
|
||||||
switch name {
|
switch name {
|
||||||
|
|||||||
Reference in new issue
Block a user