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

View File

@ -20,7 +20,6 @@ type Rows struct {
stmt *core.Stmt stmt *core.Stmt
rows *core.Rows rows *core.Rows
fields []string fields []string
fieldsCount int
beanType reflect.Type beanType reflect.Type
lastError error lastError error
} }
@ -82,7 +81,6 @@ func newRows(session *Session, bean interface{}) (*Rows, error) {
rows.Close() rows.Close()
return nil, err return nil, err
} }
rows.fieldsCount = len(rows.fields)
return rows, nil 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) 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 return err
} }