mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
remove extra nesting
This commit is contained in:
parent
87b3438cb1
commit
a0a641c541
1 changed files with 21 additions and 21 deletions
42
executor.go
42
executor.go
|
|
@ -1198,28 +1198,28 @@ func (e *executor) executeRowsShard(_ context.Context, index string, fieldName s
|
|||
|
||||
// If min/max are empty, there were no time views.
|
||||
if min == "" || max == "" {
|
||||
views = []string{}
|
||||
} else {
|
||||
// Convert min/max from string to time.Time.
|
||||
minTime, err := timeOfView(min, false)
|
||||
if err != nil {
|
||||
return rowIDs, errors.Wrapf(err, "getting min time from view: %s", min)
|
||||
}
|
||||
if fromTime.IsZero() || fromTime.Before(minTime) {
|
||||
fromTime = minTime
|
||||
}
|
||||
|
||||
maxTime, err := timeOfView(max, true)
|
||||
if err != nil {
|
||||
return rowIDs, errors.Wrapf(err, "getting max time from view: %s", max)
|
||||
}
|
||||
if toTime.IsZero() || toTime.After(maxTime) {
|
||||
toTime = maxTime
|
||||
}
|
||||
|
||||
// Determine the views based on the specified time range.
|
||||
views = viewsByTimeRange(viewStandard, fromTime, toTime, q)
|
||||
return rowIDs, nil
|
||||
}
|
||||
|
||||
// Convert min/max from string to time.Time.
|
||||
minTime, err := timeOfView(min, false)
|
||||
if err != nil {
|
||||
return rowIDs, errors.Wrapf(err, "getting min time from view: %s", min)
|
||||
}
|
||||
if fromTime.IsZero() || fromTime.Before(minTime) {
|
||||
fromTime = minTime
|
||||
}
|
||||
|
||||
maxTime, err := timeOfView(max, true)
|
||||
if err != nil {
|
||||
return rowIDs, errors.Wrapf(err, "getting max time from view: %s", max)
|
||||
}
|
||||
if toTime.IsZero() || toTime.After(maxTime) {
|
||||
toTime = maxTime
|
||||
}
|
||||
|
||||
// Determine the views based on the specified time range.
|
||||
views = viewsByTimeRange(viewStandard, fromTime, toTime, q)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue