// IndexRange range index by rank
437033
func (s *session) IndexRange(index Index, start, stop int64, opts ...RangeOption) (RangeResult, error) {
	action, result, err := s.indexRange(index, start, stop, s.applyRangeOption(opts))
	if err != nil {
		return nil, s.catch("IndexRange: "+action, err)
	}
	return result, nil
}
322120
func (c *Connector) RemoveRange(ctx context.Context, ei *dosa.EntityInfo, columnConditions map[string][]*dosa.Condition) error {
	if c.Next == nil {
		return NewErrNoMoreConnector()
	}
	return c.Next.RemoveRange(ctx, ei, columnConditions)
}
1305853
func (idx *UniqueIndex) Range(min []byte, max []byte, opts *Options) ([][]byte, error) {
	var list [][]byte

	c := internal.RangeCursor{
		C:       idx.IndexBucket.Cursor(),
		Reverse: opts != nil && opts.Reverse,
		Min:     min,
		Max:     max,
		CompareFn: func(val, limit []byte) int {
			return bytes.Compare(val, limit)
		},
	}

	for val, ident := c.First(); val != nil && c.Continue(val); val, ident = c.Next() {
		if opts != nil && opts.Skip > 0 {
			opts.Skip--
			continue
		}

		if opts != nil && opts.Limit == 0 {
			break
		}

		if opts != nil && opts.Limit > 0 {
			opts.Limit--
		}

		list = append(list, ident)
	}
	return list, nil
}
28571
func (b *rangeBuilder) Range() (*Range, error) {
	if b.err != nil {
		return nil, b.err
	}
	if b.r.from != nil && b.r.to != nil && *b.r.to < *b.r.from {
		return nil, ErrInvalidRange
	}
	return &b.r, nil
}
944311
func (eng *engine) IndexRangeByLex(index Index, min, max string, opts ...RangeOption) (RangeLexResult, error) {
	s := eng.newSession()
	defer s.Close()
	action, result, err := s.indexRangeByLex(index, min, max, s.applyRangeOption(opts))
	if err != nil {
		return nil, s.catch("IndexRangeByLex: "+action, err)
	}
	return result, nil
}
856988
func (db *PublicRecord) QueryRange(start, stop *wire.ShaHash) (*ombjson.Page, error) {
	// Find the heights of the block hashes.
	startH, err := db.FindHeight(start)
	if err != nil {
		return nil, err
	}
	stopH, err := db.FindHeight(stop)
	if err != nil {
		return nil, err
	}

	// Query for bltns between heights
	rows, err := db.selectBltnsHeight.Query(startH, stopH)
	defer rows.Close()
	if err != nil {
		return nil, err
	}

	bltns, err := scanBltns(rows)
	if err != nil {
		return nil, err
	}

	endos, err := db.GetEndosByHeight(startH, stopH)
	if err != nil {
		return nil, err
	}

	page := &ombjson.Page{
		Start:        start.String(),
		Stop:         stop.String(),
		Bulletins:    bltns,
		Endorsements: endos,
	}

	return page, nil
}
523139
func (o *GetObjectOptions) SetRange(start, end int64) error {
	switch {
	case start == 0 && end < 0:
		// Read last '-end' bytes. `bytes=-N`.
		o.Set("Range", fmt.Sprintf("bytes=%d", end))
	case 0 < start && end == 0:
		// Read everything starting from offset
		// 'start'. `bytes=N-`.
		o.Set("Range", fmt.Sprintf("bytes=%d-", start))
	case 0 <= start && start <= end:
		// Read everything starting at 'start' till the
		// 'end'. `bytes=N-M`
		o.Set("Range", fmt.Sprintf("bytes=%d-%d", start, end))
	default:
		// All other cases such as
		// bytes=-3-
		// bytes=5-3
		// bytes=-2-4
		// bytes=-3-0
		// bytes=-3--2
		// are invalid.
		return ErrInvalidArgument(
			fmt.Sprintf(
				"Invalid range specified: start=%d end=%d",
				start, end))
	}
	return nil
}
447947
func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) {
	if t.root == nil {
		return
	}
	t.root.iterate(ascend, greaterOrEqual, lessThan, true, false, iterator)
}
670351
func (c *shellQueryClient) Range(ctx context.Context, ops []*queryObj, fields []string, limit int) ([]map[string]dosa.FieldValue, error) {
	// look up the entity in the registry
	re, _ := c.registrar.Find(&dosa.Entity{})

	// build range operator with expressions and limit number
	r, err := buildRangeOp(ops, limit)
	if err != nil {
		return nil, err
	}

	// now convert the client range columns to server side column conditions structure
	columnConditions, err := dosa.ConvertConditions(r.Conditions(), re.Table())
	if err != nil {
		return nil, err
	}

	// convert the field names to column names
	columns, err := re.ColumnNames(fields)
	if err != nil {
		return nil, err
	}

	// call the server side method
	values, _, err := c.connector.Range(ctx, re.EntityInfo(), columnConditions, columns, "", r.LimitRows())
	if err != nil {
		return nil, err
	}

	return convertColToField(values, re.Table().ColToField), err
}
276183
func valueRange(a, b, base int) []int {
	value := make([]int, absoluteOverBreakpoint(a, b, base)+1)
	i := 0
	for ; a != b; a++ {
		if a == base {
			a = 0
		}
		value[i] = a
		i++
	}
	value[i] = a
	return value
}
263016
func (c *Client) LRange(key string, begin, end int) ([]string, error) {
	v, err := c.execWithKey(true, "LRANGE", key, begin, end)
	if err != nil {
		return []string{}, err
	}
	return iface2vstr(v), nil
}
1286110
func (t *ImmutableTree) IterateRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) (stopped bool) {
	if t.root == nil {
		return false
	}
	return t.root.traverseInRange(t, start, end, ascending, false, 0, func(node *Node, _ uint8) bool {
		if node.height == 0 {
			return fn(node.key, node.value)
		}
		return false
	})
}
1279343
func (md *MDServerRemote) GetRange(ctx context.Context, id tlf.ID,
	bid kbfsmd.BranchID, mStatus kbfsmd.MergeStatus,
	start, stop kbfsmd.Revision, lockBeforeGet *keybase1.LockID) (
	rmdses []*RootMetadataSigned, err error) {
	ctx = rpc.WithFireNow(ctx)
	md.log.LazyTrace(ctx, "MDServer: GetRange %s %s %s %d-%d", id, bid, mStatus, start, stop)
	defer func() {
		md.deferLog.LazyTrace(ctx, "MDServer: GetRange %s %s %s %d-%d done (err=%v)", id, bid, mStatus, start, stop, err)
	}()

	arg := keybase1.GetMetadataArg{
		FolderID:      id.String(),
		BranchID:      bid.String(),
		Unmerged:      mStatus == kbfsmd.Unmerged,
		StartRevision: start.Number(),
		StopRevision:  stop.Number(),
		LockBeforeGet: lockBeforeGet,
	}

	_, rmds, err := md.get(ctx, arg)
	return rmds, err
}
1053351
func (tf tFiles) getRange(icmp *iComparer) (imin, imax internalKey) {
	for i, t := range tf {
		if i == 0 {
			imin, imax = t.imin, t.imax
			continue
		}
		if icmp.Compare(t.imin, imin) < 0 {
			imin = t.imin
		}
		if icmp.Compare(t.imax, imax) > 0 {
			imax = t.imax
		}
	}

	return
}
1174838
func (s *session) IndexRangeByScore(index Index, min, max int64, opts ...RangeOption) (RangeResult, error) {
	action, result, err := s.indexRangeByScore(index, min, max, s.applyRangeOption(opts))
	if err != nil {
		return nil, s.catch("IndexRangeByScore: "+action, err)
	}
	return result, nil
}
270300
func (c *Client) GetRange(key string, start, end int) (string, error) {
	v, err := c.execWithKey(true, "GETRANGE", key, start, end)
	if err != nil {
		return "", err
	}
	switch v.(type) {
	case string:
		return v.(string), nil
	}
	return "", ErrServerError
}
53310
func (s *GetJobOutputInput) SetRange(v string) *GetJobOutputInput {
	s.Range = &v
	return s
}