Just my OCD playing up 😉

This commit is contained in:
Sander van Harmelen 2015-01-16 13:30:11 +01:00
parent b29c490f2d
commit 2edfd0e89d
1 changed files with 6 additions and 7 deletions

View File

@ -251,6 +251,12 @@ func (w *MapFieldWriter) setSet(
schema *Schema) error {
addrCopy := make([]string, len(addr), len(addr)+1)
copy(addrCopy, addr)
k := strings.Join(addr, ".")
if value == nil {
w.result[k+".#"] = "0"
return nil
}
// If it is a slice, then we have to turn it into a *Set so that
// we get the proper order back based on the hash code.
@ -292,13 +298,6 @@ func (w *MapFieldWriter) setSet(
value = s
}
k := strings.Join(addr, ".")
if value == nil {
w.result[k+".#"] = "0"
return nil
}
for code, elem := range value.(*Set).m {
codeStr := strconv.FormatInt(int64(code), 10)
if err := w.set(append(addrCopy, codeStr), elem); err != nil {