Skip to content

Commit

Permalink
Performance improvement for columnsbyName
Browse files Browse the repository at this point in the history
  • Loading branch information
xormplus committed Sep 12, 2020
1 parent 5686e64 commit 5d90dcd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions schemas/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,7 @@ func (table *Table) ColumnsSeq() []string {
}

func (table *Table) columnsByName(name string) []*Column {
for k, cols := range table.columnsMap {
if strings.EqualFold(k, name) {
return cols
}
}
return nil
return table.columnsMap[strings.ToLower(name)]
}

// GetColumn returns column according column name, if column not found, return nil
Expand Down
2 changes: 1 addition & 1 deletion xorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

const (
// Version show the xorm's version
Version string = "1.0.3.0731"
Version string = "1.0.5.0912"
)

func close(engine *Engine) {
Expand Down

0 comments on commit 5d90dcd

Please sign in to comment.