remove unused field of rows

This commit is contained in:
Lunny Xiao 2017-03-01 16:38:15 +08:00
parent 382b85d765
commit 2b462f7180
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 7 additions and 9 deletions

16
rows.go
View File

@ -16,13 +16,12 @@ import (
type Rows struct {
NoTypeCheck bool
session *Session
stmt *core.Stmt
rows *core.Rows
fields []string
fieldsCount int
beanType reflect.Type
lastError error
session *Session
stmt *core.Stmt
rows *core.Rows
fields []string
beanType reflect.Type
lastError error
}
func newRows(session *Session, bean interface{}) (*Rows, error) {
@ -82,7 +81,6 @@ func newRows(session *Session, bean interface{}) (*Rows, error) {
rows.Close()
return nil, err
}
rows.fieldsCount = len(rows.fields)
return rows, nil
}
@ -114,7 +112,7 @@ func (rows *Rows) Scan(bean interface{}) error {
return fmt.Errorf("scan arg is incompatible type to [%v]", rows.beanType)
}
_, err := rows.session.row2Bean(rows.rows, rows.fields, rows.fieldsCount, bean)
_, err := rows.session.row2Bean(rows.rows, rows.fields, len(rows.fields), bean)
return err
}