mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 19:37:51 +00:00
replace switch with simplified if statement
This commit is contained in:
parent
3d33cdbb74
commit
338f69b71d
1 changed files with 3 additions and 7 deletions
10
executor.go
10
executor.go
|
|
@ -1226,11 +1226,7 @@ func (e *executor) executeSetRow(ctx context.Context, index string, c *pql.Call,
|
|||
if field == nil {
|
||||
return false, ErrFieldNotFound
|
||||
}
|
||||
|
||||
switch field.Type() {
|
||||
case FieldTypeSet:
|
||||
// These field types support SetRow().
|
||||
default:
|
||||
if field.Type() != FieldTypeSet {
|
||||
return false, fmt.Errorf("SetRow() is not supported on %s field types", field.Type())
|
||||
}
|
||||
|
||||
|
|
@ -1298,11 +1294,11 @@ func (e *executor) executeSetRowShard(ctx context.Context, index string, c *pql.
|
|||
return false, errors.Wrapf(err, "creating fragment: %d", shard)
|
||||
}
|
||||
}
|
||||
cleared, err := fragment.setRow(src, rowID)
|
||||
set, err := fragment.setRow(src, rowID)
|
||||
if err != nil {
|
||||
return false, errors.Wrapf(err, "setting row %d on view %s shard %d", rowID, viewStandard, shard)
|
||||
}
|
||||
changed = changed || cleared
|
||||
changed = changed || set
|
||||
|
||||
return changed, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue