From 3aafbed39048007c99cb2b1dc9daf734cf4eae66 Mon Sep 17 00:00:00 2001 From: qiangxue Date: Wed, 7 Sep 2016 15:45:16 -0400 Subject: [PATCH] optimization --- struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/struct.go b/struct.go index 79969d3..5928140 100644 --- a/struct.go +++ b/struct.go @@ -100,7 +100,7 @@ func (s *structValue) pk() map[string]interface{} { // columns returns the struct field values indexed by their corresponding DB column names. func (s *structValue) columns(include, exclude []string) map[string]interface{} { - v := map[string]interface{}{} + v := make(map[string]interface{}, len(s.nameMap)) if len(include) == 0 { for _, fi := range s.nameMap { v[fi.dbName] = fi.getValue(s.value)