// DeleteIndex removes an index from the holder.
501777
func (h *Holder) DeleteIndex(name string) error {
	h.mu.Lock()
	defer h.mu.Unlock()

	// Confirm index exists.
	index := h.index(name)
	if index == nil {
		return newNotFoundError(ErrIndexNotFound)
	}

	// Close index.
	if err := index.Close(); err != nil {
		return errors.Wrap(err, "closing")
	}

	// Delete index directory.
	if err := os.RemoveAll(h.IndexPath(name)); err != nil {
		return errors.Wrap(err, "removing directory")
	}

	// Remove reference.
	delete(h.indexes, name)

	return nil
}
1053418
func (d *Context) NormalizeIndex(index int) int {
	return int(C.duk_normalize_index(d.duk_context, C.duk_idx_t(index)))
}
387182
func DropAddrIndex(db database.DB, interrupt <-chan struct{}) error {
	return dropIndex(db, addrIndexKey, addrIndexName, interrupt)
}
1201233
func (s *BatchDetectSentimentItemResult) SetIndex(v int64) *BatchDetectSentimentItemResult {
	s.Index = &v
	return s
}
1243745
func (client *BaseClient) RemoveFilterByIndex(index int) Client {
	client.filterManager.RemoveFilterByIndex(index)
	return client
}
444709
func (z *ZipArchive) DeleteIndex(idx int) error {
	if idx >= z.NumFiles {
		return errors.New("index out of range of number of files")
	}

	z.files = append(z.files[:idx], z.files[idx+1:]...)
	return nil
}
830027
func (db *DB) DeleteAllEntriesAfterIndex(index int) {
	db.mu.Lock()
	defer db.mu.Unlock()

	if index < 0 || index >= len(db.expectedExecuteFetch) {
		panic(fmt.Sprintf("index out of range. current length: %v", len(db.expectedExecuteFetch)))
	}

	if index+1 < db.expectedExecuteFetchIndex {
		// Don't delete entries which were already answered.
		return
	}

	db.expectedExecuteFetch = db.expectedExecuteFetch[:index+1]
}
1372198
func (s *Store) RemoveIndex(dataType interface{}, indexName string) error {
	storer := newStorer(dataType)
	return s.Bolt().Update(func(tx *bolt.Tx) error {
		return tx.DeleteBucket(indexBucketName(storer.Type(), indexName))

	})
}
515383
func (vector *BitVector) Delete(index int) {
	vector.indexAssert(index)
	vector.length--
	byteIndex := uint32(index >> 3)
	byteOffset := uint32(index % 8)

	oldByte := vector.data[byteIndex]

	// Shift all the bytes above the byte we're modifying, return the
	// leftover bit to include in the byte we're modifying.
	bit := shiftLower(0, vector.data[byteIndex+1:])

	// Modify oldByte.
	// At a high level, we want to select the bits above byteOffset,
	// and shift them down by one, removing the bit at byteOffset.

	// This selects the bottom bits
	bottomMask := byte((1 << byteOffset) - 1)
	// This selects the top (8 - byteOffset - 1) bits
	topMask := byte(^((1 << (byteOffset + 1)) - 1))
	// newTop is the top bits, shifted down one, combined with the leftover bit from shifting
	// the other bytes.
	newTop := (oldByte&topMask)>>1 | (bit << 7)
	// newByte takes the bottom bits and combines with the new top.
	newByte := (bottomMask & oldByte) | newTop
	vector.data[byteIndex] = newByte

	// The desired length is the byte index of the last element plus one,
	// where the byte index of the last element is the bit index of the last
	// element divided by 8.
	byteLength := vector.bytesLength()
	if byteLength < len(vector.data) {
		vector.data = vector.data[:byteLength]
	}
}
737462
func (t *Transaction) deleteNumericOrBooleanIndex(fs *fieldSpec, ms *modelSpec, modelID string) {
	indexKey, err := ms.fieldIndexKey(fs.name)
	if err != nil {
		t.setError(err)
	}
	t.Command("ZREM", redis.Args{indexKey, modelID}, nil)
}
180117
func (l *linkIndex) delete(container *container.Container) []string {
	l.mu.Lock()

	var aliases []string
	for alias, child := range l.idx[container] {
		aliases = append(aliases, alias)
		delete(l.childIdx[child], container)
	}
	delete(l.idx, container)
	delete(l.childIdx, container)
	l.mu.Unlock()
	return aliases
}
46956
func (memory *InMemory) DeleteAll() error {
	memory.mu.Lock()
	defer memory.mu.Unlock()
	memory.Messages = make([]*data.Message, 0)
	memory.MessageIDIndex = make(map[string]int)
	return nil
}
596909
func (s *StateStore) DeleteNode(index uint64, nodeID string) error {
	txn := s.db.Txn(true)
	defer txn.Abort()

	// Lookup the node
	existing, err := txn.First("nodes", "id", nodeID)
	if err != nil {
		return fmt.Errorf("node lookup failed: %v", err)
	}
	if existing == nil {
		return fmt.Errorf("node not found")
	}

	// Delete the node
	if err := txn.Delete("nodes", existing); err != nil {
		return fmt.Errorf("node delete failed: %v", err)
	}
	if err := txn.Insert("index", &IndexEntry{"nodes", index}); err != nil {
		return fmt.Errorf("index update failed: %v", err)
	}

	txn.Commit()
	return nil
}
692201
func (s *DB) RemoveIndex(indexName string) *DB {
	scope := s.NewScope(s.Value)
	scope.removeIndex(indexName)
	return scope.db
}
173565
func (f Index) Delete(keyFields Item) (err error) {
	key, err := f.encodeKeyFunc(keyFields)
	if err != nil {
		return err
	}
	return f.db.Delete(key)
}
1220075
func (engine *Engine) DropIndexes(bean interface{}) error {
	session := engine.NewSession()
	defer session.Close()
	return session.DropIndexes(bean)
}
1169324
func (s *StateStore) RemoveIndex(name string) error {
	txn := s.db.Txn(true)
	defer txn.Abort()

	if _, err := txn.DeleteAll("index", "id", name); err != nil {
		return err
	}

	txn.Commit()
	return nil
}