lib/storage: remove unused code from getMetricIDsForTimeRange: it is expected that time range is always non-zero

This commit is contained in:
Aliaksandr Valialkin 2019-11-09 19:02:18 +02:00
parent 823fa085ef
commit e573ef2126
2 changed files with 0 additions and 7 deletions

View file

@ -1921,9 +1921,6 @@ var errFallbackToMetricNameMatch = errors.New("fall back to updateMetricIDsByMet
var errMissingMetricIDsForDate = errors.New("missing metricIDs for date")
func (is *indexSearch) getMetricIDsForTimeRange(tr TimeRange, maxMetrics int) (*uint64set.Set, error) {
if tr.isZero() {
return nil, errMissingMetricIDsForDate
}
atomic.AddUint64(&is.db.recentHourMetricIDsSearchCalls, 1)
if metricIDs, ok := is.getMetricIDsForRecentHours(tr, maxMetrics); ok {
// Fast path: tr covers the current and / or the previous hour.

View file

@ -31,10 +31,6 @@ func (tr *TimeRange) String() string {
return fmt.Sprintf("[%s - %s]", minTime, maxTime)
}
func (tr *TimeRange) isZero() bool {
return tr.MinTimestamp == 0 && tr.MaxTimestamp == 0
}
// timestampToPartitionName returns partition name for the given timestamp.
func timestampToPartitionName(timestamp int64) string {
t := timestampToTime(timestamp)