// RemoveDuplicateField remove the duplicate field
1098
func RemoveDuplicateField(data string) string {
	fs := []string{}

	for _, v := range strings.Split(data, ",") {
		if strings.TrimSpace(v) != "" {
			fs = append(fs, v)
		}
	}

	fields := xslice.Unique(fs)
	result := strings.Join(fields.([]string), ",")

	return result
}
594192
func cloneField(field *ObjectField) {
	if field.Method != nil {
		field.Method = Clone(field.Method).(*Function)
	}

	oldParams := field.Params
	if oldParams != nil {
		field.Params = new(Parameters)
		*field.Params = *oldParams
	}
	cloneParameters(field.Params)

	clone(&field.Expr1)
	clone(&field.Expr2)
	clone(&field.Expr3)
}
1089135
func (c *Cluster) Removed() []uint64 {
	c.mu.RLock()
	removed := make([]uint64, 0, len(c.removed))
	for k := range c.removed {
		removed = append(removed, k)
	}
	c.mu.RUnlock()
	return removed
}
542823
func (b *SampleFJSONBuilder) Remove(info *SampleFPropertyInfo) *SampleFJSONBuilder {
	delete(b._properties, info.fieldName)
	return b
}
111449
func (idx *AddrIndex) RemoveUnconfirmedTx(hash *chainhash.Hash) {
	idx.unconfirmedLock.Lock()
	defer idx.unconfirmedLock.Unlock()

	// Remove all address references to the transaction from the address
	// index and remove the entry for the address altogether if it no longer
	// references any transactions.
	for addrKey := range idx.addrsByTx[*hash] {
		delete(idx.txnsByAddr[addrKey], *hash)
		if len(idx.txnsByAddr[addrKey]) == 0 {
			delete(idx.txnsByAddr, addrKey)
		}
	}

	// Remove the entry from the transaction to address lookup map as well.
	delete(idx.addrsByTx, *hash)
}
1312434
func (fl *TagFieldList) RemoveField(i int) error {
	if i+1 > len(fl.Fields()) || i < 0 {
		return errors.New("Invalid index for TagField")
	}
	if len(fl.fields) == i {
		fl.fields = fl.Fields()[:i]
		return nil
	}
	fl.fields = append(fl.Fields()[:i], fl.Fields()[i+1:]...)
	return nil
}
561267
func (b *BarJSONBuilder) Remove(info *BarPropertyInfo) *BarJSONBuilder {
	delete(b._properties, info.fieldName)
	return b
}
51318
func (b *PersonJSONBuilder) Remove(info *PersonPropertyInfo) *PersonJSONBuilder {
	delete(b._properties, info.fieldName)
	return b
}
162020
func (b *SampleJSONBuilder) Remove(info *SamplePropertyInfo) *SampleJSONBuilder {
	delete(b._properties, info.fieldName)
	return b
}
436650
func RemoveShardReplicationRecord(ctx context.Context, ts *Server, cell, keyspace, shard string, tabletAlias *topodatapb.TabletAlias) error {
	err := ts.UpdateShardReplicationFields(ctx, cell, keyspace, shard, func(sr *topodatapb.ShardReplication) error {
		nodes := make([]*topodatapb.ShardReplication_Node, 0, len(sr.Nodes))
		for _, node := range sr.Nodes {
			if !proto.Equal(node.TabletAlias, tabletAlias) {
				nodes = append(nodes, node)
			}
		}
		sr.Nodes = nodes
		return nil
	})
	return err
}
185339
func RemoveOn(scope app.Scope, eventID int, file filesystem.File) error {
	var def *FileDefer
	insKey := "_scopedefer.FileDefer:" + strconv.Itoa(eventID)
	fileDeferIns, err := scope.Get(insKey)
	if err != nil || fileDeferIns == nil {
		def = &FileDefer{
			files: []filesystem.File{file},
		}
		scope.On(eventID, def.Remove)
	} else {
		def = fileDeferIns.(*FileDefer)
		def.Add(file)
	}
	return nil
}
957308
func (m *Model) removeApplication(ch RemoveApplication) error {
	defer m.doLocked()()

	app, ok := m.applications[ch.Name]
	if ok {
		if err := app.evict(); err != nil {
			return errors.Trace(err)
		}
		delete(m.applications, ch.Name)
	}
	return nil
}
851330
func (g *GroupOperations) Remove(connectionID string) {
	g.e.removeFromGroupByID(g.group, connectionID)
}
697652
func removeDuplicates(items []legacy.Item) []legacy.Item {
	// Use map to record duplicates as we find them.
	encountered := map[string]bool{}
	result := make([]legacy.Item, 0, len(items))

	// Loop over all items, if it has not been seen before, append to result.
	for _, e := range items {
		_, ok := encountered[e.FullPath]
		if !ok {
			// Record this element as an encountered element.
			encountered[e.FullPath] = true

			// Append to result slice.
			result = append(result, e)
		}
	}

	return result
}
1260532
func (s structInfo) ignoreField(name string) bool {
	_, ignore := s.ignoreDups[name]
	return ignore
}
1305048
func (r *Registry) RemoveReference(obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) {
	r.WithLock(obj, func() {
		RemoveReference(field, ref)
	})
}
407095
func (pgb *ChainDB) DeleteDuplicates(barLoad chan *dbtypes.ProgressBarLoad) error {
	allDuplicates := []dropDuplicatesInfo{
		// Remove duplicate vins
		{TableName: "vins", DropDupsFunc: pgb.DeleteDuplicateVins},

		// Remove duplicate vouts
		{TableName: "vouts", DropDupsFunc: pgb.DeleteDuplicateVouts},

		// Remove duplicate transactions
		{TableName: "transactions", DropDupsFunc: pgb.DeleteDuplicateTxns},

		// Remove duplicate agendas
		{TableName: "agendas", DropDupsFunc: pgb.DeleteDuplicateAgendas},

		// Remove duplicate agenda_votes
		{TableName: "agenda_votes", DropDupsFunc: pgb.DeleteDuplicateAgendaVotes},
	}

	var err error
	for _, val := range allDuplicates {
		msg := fmt.Sprintf("Finding and removing duplicate %s entries...", val.TableName)
		if barLoad != nil {
			barLoad <- &dbtypes.ProgressBarLoad{BarID: dbtypes.InitialDBLoad, Subtitle: msg}
		}
		log.Info(msg)

		var numRemoved int64
		if numRemoved, err = val.DropDupsFunc(); err != nil {
			return fmt.Errorf("delete %s duplicate failed: %v", val.TableName, err)
		}

		msg = fmt.Sprintf("Removed %d duplicate %s entries.", numRemoved, val.TableName)
		if barLoad != nil {
			barLoad <- &dbtypes.ProgressBarLoad{BarID: dbtypes.InitialDBLoad, Subtitle: msg}
		}
		log.Info(msg)
	}
	// Signal task is done
	if barLoad != nil {
		barLoad <- &dbtypes.ProgressBarLoad{BarID: dbtypes.InitialDBLoad, Subtitle: " "}
	}
	return nil
}