// Remove deletes a transaction from the maintained list, returning whether the
// transaction was found, and also returning any transaction invalidated due to
// the deletion (strict mode only).
355742
func (l *txList) Remove(tx *types.Transaction) (bool, types.Transactions) {
	// Remove the transaction from the set
	nonce := tx.Nonce()
	if removed := l.txs.Remove(nonce); !removed {
		return false, nil
	}
	// In strict mode, filter out non-executable transactions
	if l.strict {
		return true, l.txs.Filter(func(tx *types.Transaction) bool { return tx.Nonce() > nonce })
	}
	return true, nil
}
1330247
func (addr *Address) Remove() (err error) {
	defer errors.DeferredAnnotatef(&err, "cannot remove %s", addr)

	removeOp := removeIPAddressDocOp(addr.doc.DocID)
	ops := []txn.Op{removeOp}
	if addr.ProviderID() != "" {
		op := addr.st.networkEntityGlobalKeyRemoveOp("address", addr.ProviderID())
		ops = append(ops, op)
	}
	return addr.st.db().RunTransaction(ops)
}
1051573
func (s *store) Remove(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID,
	msgs []chat1.MessageUnboxed) (err error) {
	defer s.Trace(ctx, func() error { return err }, "Remove")()
	s.Lock()
	defer s.Unlock()

	md, err := s.GetMetadata(ctx, uid, convID)
	if err != nil {
		return err
	}

	seenIDs := md.SeenIDs
	for _, msg := range msgs {
		// Don't remove if we haven't seen
		if _, ok := seenIDs[msg.GetMessageID()]; !ok {
			continue
		}
		seenIDs[msg.GetMessageID()] = chat1.EmptyStruct{}
		s.removeMsg(ctx, uid, convID, msg)
	}
	err = s.putMetadata(ctx, uid, convID, md)
	return err
}
230992
func (s *Scheduler) Remove(ctx context.Context, appID string) error {
	tx, err := s.db.Begin()
	if err != nil {
		return err
	}

	err = s.remove(ctx, tx, appID)
	if err != nil {
		tx.Rollback()
		return err
	}

	return tx.Commit()
}
493648
func (l *List) Remove() error {
	err := (*bbolt.DB)(l.db).Update(func(tx *bbolt.Tx) error {
		return tx.DeleteBucket(l.name)
	})
	// Mark as removed by setting the name to nil
	l.name = nil
	return err
}
739118
func (m *idManager) remove(i uint64) *queue.TxBuffer {
	if i >= uint64(len(m.ids)) {
		return nil
	}

	desc := &m.ids[i]
	b := desc.buf
	if b == nil {
		// The provided id is not currently assigned.
		return nil
	}

	desc.buf = nil
	desc.nextFree = m.freeList
	m.freeList = i

	return b
}
101002
func (c *cache) remove(key string) {
	if cached, ok := c.items[key]; ok {
		delete(c.items, key)
		c.size -= cached.item.Size()
		c.keyList.Remove(cached.element)
	}
}
313333
func (s strings) Remove(in []string, remove ...string) []string {
	return s.Filter(in, func(item string) bool {
		found := false
		for _, removeItem := range remove {
			if removeItem == item {
				found = true
			}
		}
		return !found
	})
}
420023
func (t *OSesTable) remove(c context.Context) error {
	// Avoid using the database connection to prepare unnecessary statements.
	if len(t.removals) == 0 {
		return nil
	}

	db := database.Get(c)
	stmt, err := db.PrepareContext(c, `
		DELETE FROM oses
		WHERE id = ?
	`)
	if err != nil {
		return errors.Annotate(err, "failed to prepare statement").Err()
	}
	defer stmt.Close()

	// Remove each operating system from the table. It's more efficient to update the slice of
	// operating systems once at the end rather than for each removal, so use a defer.
	removed := make(map[int64]struct{}, len(t.removals))
	defer func() {
		var oses []*OS
		for _, os := range t.current {
			if _, ok := removed[os.Id]; !ok {
				oses = append(oses, os)
			}
		}
		t.current = oses
	}()
	for len(t.removals) > 0 {
		os := t.removals[0]
		if _, err := stmt.ExecContext(c, os.Id); err != nil {
			// Defer ensures the slice of operating systems is updated even if we exit early.
			return errors.Annotate(err, "failed to remove operating system %q", os.Name).Err()
		}
		removed[os.Id] = struct{}{}
		t.removals = t.removals[1:]
		logging.Infof(c, "Removed operating system %q", os.Name)
	}
	return nil
}
695492
func (l *ItemList) Remove(e *ItemElement) Item {
	if e.list == l {
		// if e.list == l, l must have been initialized when e was inserted
		// in l or l == nil (e is a zero Element) and l.remove will crash
		l.remove(e)
	}
	return e.Value
}
55458
func (s *Session) Remove(ctx context.Context, key string) {
	sd := s.getSessionDataFromContext(ctx)

	sd.mu.Lock()
	defer sd.mu.Unlock()

	_, exists := sd.Values[key]
	if !exists {
		return
	}

	delete(sd.Values, key)
	sd.status = Modified
}
328185
func (s *Scheduler) remove(_ context.Context, tx *sql.Tx, appID string) error {
	stackName, err := s.stackName(appID)

	// if there's no stack entry in the db for this app, nothing to remove
	if err == errNoStack {
		return nil
	}
	if err != nil {
		return err
	}

	_, err = tx.Exec(`DELETE FROM stacks WHERE app_id = $1`, appID)
	if err != nil {
		return err
	}

	_, err = s.cloudformation.DescribeStacks(&cloudformation.DescribeStacksInput{
		StackName: aws.String(stackName),
	})
	if err, ok := err.(awserr.Error); ok && err.Message() == fmt.Sprintf("Stack with id %s does not exist", stackName) {
		return nil
	}

	if _, err := s.cloudformation.DeleteStack(&cloudformation.DeleteStackInput{
		StackName: aws.String(stackName),
	}); err != nil {
		return fmt.Errorf("error deleting stack: %v", err)
	}

	return nil
}
927080
func (rh *HashMap) Remove() error {
	conn := rh.pool.Get(rh.dbindex)
	// Find all hashmap keys that starts with rh.id+":"
	results, err := redis.Values(conn.Do("KEYS", rh.id+":*"))
	if err != nil {
		return err
	}
	// For each key id
	for i := 0; i < len(results); i++ {
		// Delete this key
		if _, err = conn.Do("DEL", getString(results, i)); err != nil {
			return err
		}
	}
	return nil
}
459010
func (s *stringSet) Remove(vs ...string) {
	for _, v := range vs {
		delete(s.values, v)
	}
}
726713
func (fb *Firebase) Remove() error {
	_, _, err := fb.doRequest("DELETE", nil)
	if err != nil {
		return err
	}
	return nil
}
1146992
func (c *Cache) Remove(key interface{}) (val interface{}, has bool) {
	c.lock.Lock()
	defer c.lock.Unlock()

	if e, ok := c.cache[key]; ok {
		val, has = e.Value.(*cacheEntry).v, true
		c.evictEntryLocked(e)
	}
	return
}
629766
func (c *Client) Remove(name string) error {
	return delete(c, name, false)
}