small optimization

This commit is contained in:
Lunny Xiao 2016-07-07 09:01:13 +08:00
parent b7ab22b84c
commit 9bf34c3189
2 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,7 @@ Xorm is a simple and powerful ORM for Go.
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-xorm/xorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-xorm/xorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Build Status](https://drone.io/github.com/go-xorm/tests/status.png)](https://drone.io/github.com/go-xorm/tests/latest) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/go-xorm/xorm) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lunny/xorm/trend.png)](https://bitdeli.com/free "Bitdeli Badge") [![Build Status](https://drone.io/github.com/go-xorm/tests/status.png)](https://drone.io/github.com/go-xorm/tests/latest)
# Notice # Notice
@ -61,7 +61,7 @@ Drivers for Go's sql package which currently support database/sql includes:
* **v0.4.5** * **v0.4.5**
* many bugs fixed * many bugs fixed
* extends support unlimited deep * extends support unlimited deepth
* Delete Limit support * Delete Limit support
* **v0.4.4** * **v0.4.4**

View File

@ -1840,8 +1840,9 @@ func (session *Session) _row2Bean(rows *core.Rows, fields []string, fieldsCount
return err return err
} }
if has { if has {
v := structInter.Elem().Interface() //v := structInter.Elem().Interface()
fieldValue.Set(reflect.ValueOf(v)) //fieldValue.Set(reflect.ValueOf(v))
fieldValue.Set(structInter.Elem())
} else { } else {
return errors.New("cascade obj is not exist!") return errors.New("cascade obj is not exist!")
} }