Merge pull request #820 from svanharmelen/f-core-ocd-fixups

core: ocd fixups, cosmetic only
This commit is contained in:
Sander van Harmelen 2015-01-16 13:35:58 +01:00
commit 49b3afe452
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 {