mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 15:12:22 +08:00
chore: preallocate slices where we have a good idea of requirements (#91596)
* chore: preallocate slices where we have a good idea of requirements * pr feedback
This commit is contained in:
@ -1096,10 +1096,10 @@ func (db *postgres) GetTables() ([]*core.Table, error) {
|
||||
}
|
||||
|
||||
func getIndexColName(indexdef string) []string {
|
||||
var colNames []string
|
||||
|
||||
cs := strings.Split(indexdef, "(")
|
||||
for _, v := range strings.Split(strings.Split(cs[1], ")")[0], ",") {
|
||||
splitNames := strings.Split(strings.Split(cs[1], ")")[0], ",")
|
||||
colNames := make([]string, 0, len(splitNames))
|
||||
for _, v := range splitNames {
|
||||
colNames = append(colNames, strings.Split(strings.TrimLeft(v, " "), " ")[0])
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user