Improve naming convention (resultSet -> exists)

This commit is contained in:
Radek Simko 2016-06-25 08:50:41 +01:00
parent 917ad44cf0
commit 37d57f4a85
1 changed files with 5 additions and 5 deletions

View File

@ -59,7 +59,7 @@ func (r *DiffFieldReader) ReadField(address []string) (FieldReadResult, error) {
func (r *DiffFieldReader) readMap(
address []string, schema *Schema) (FieldReadResult, error) {
result := make(map[string]interface{})
resultSet := false
exists := false
// First read the map from the underlying source
source, err := r.Source.ReadField(address)
@ -68,7 +68,7 @@ func (r *DiffFieldReader) readMap(
}
if source.Exists {
result = source.Value.(map[string]interface{})
resultSet = true
exists = true
}
// Next, read all the elements we have in our diff, and apply
@ -83,7 +83,7 @@ func (r *DiffFieldReader) readMap(
continue
}
resultSet = true
exists = true
k = k[len(prefix):]
if v.NewRemoved {
@ -95,13 +95,13 @@ func (r *DiffFieldReader) readMap(
}
var resultVal interface{}
if resultSet {
if exists {
resultVal = result
}
return FieldReadResult{
Value: resultVal,
Exists: resultSet,
Exists: exists,
}, nil
}