// RemoveMultiples sorts an ErrorList and removes all but the first error per line.
354839
func (p *ErrorList) RemoveMultiples() {
	sort.Sort(p)
	var last token.Position // initial last.Line is != any legal error line
	i := 0
	for _, e := range *p {
		if e.Pos.Filename != last.Filename || e.Pos.Line != last.Line {
			last = e.Pos
			(*p)[i] = e
			i++
		}
	}
	(*p) = (*p)[0:i]
}
847413
func RemoveDuplicates(strings []string) []string {
	sort.Strings(strings)
	result := make([]string, 0, len(strings))
	for _, str := range strings {
		if len(result) == 0 || str != result[len(result)-1] {
			result = append(result, str)
		}
	}
	return result
}
235307
func (p *ConnPool) removeFromAllConnections(conn *Conn) bool {
	for i, c := range p.allConnections {
		if conn == c {
			p.allConnections = append(p.allConnections[:i], p.allConnections[i+1:]...)
			return true
		}
	}
	return false
}
890289
func (c *ShardedClient) DeleteMulti(keys []string) []MutateResponse {
	return c.mutateMulti(c.manager.GetShardsForKeys(keys), deleteMultiMutator)
}
510955
func RemoveChecksums(inputs []Trytes) ([]Trytes, error) {
	withoutChecksums := make([]Trytes, len(inputs))
	for i, s := range inputs {
		t, err := RemoveChecksum(s)
		if err != nil {
			return nil, err
		}
		withoutChecksums[i] = t
	}
	return withoutChecksums, nil
}
815342
func removeEmptyStrings(strings []string) []string {
	result := []string{}
	for _, s := range strings {
		if s != "" {
			result = append(result, s)
		}
	}
	return result
}
50428
func removeAll(path string) error {
	// Only need special handling for windows
	if runtime.GOOS != "windows" {
		return os.RemoveAll(path)
	}

	// Simple case: if Remove works, we're done.
	err := os.Remove(path)
	if err == nil || os.IsNotExist(err) {
		return nil
	}

	// make sure all files are writable so we can delete them
	err = filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
		if err != nil && err != filepath.SkipDir {
			// walk gave us some error, give it back.
			return err
		}
		mode := info.Mode()
		if mode|0200 == mode {
			return nil
		}

		return os.Chmod(path, mode|0200)
	})
	if err != nil {
		return err
	}

	return os.Remove(path)
}
828903
func RemoveFromSlice(slice []string, values ...string) []string {
	output := make([]string, 0, len(slice))

	remove := make(map[string]bool)
	for _, value := range values {
		remove[value] = true
	}

	for _, s := range slice {
		_, ok := remove[s]
		if ok {
			continue
		}
		output = append(output, s)
	}

	return output
}
622847
func ParseMultiple(headers []string) Links {
	links := make(Links, 0)
	for _, header := range headers {
		links = append(links, Parse(header)...)
	}
	return links
}
753899
func (m *IptablesManager) RemoveRules() {
	// Set of tables that have had iptables rules in any Cilium version
	tables := []string{"nat", "mangle", "raw", "filter"}
	for _, t := range tables {
		removeCiliumRules(t, "iptables")
	}

	// Set of tables that have had ip6tables rules in any Cilium version
	if m.ip6tables {
		tables6 := []string{"mangle", "raw"}
		for _, t := range tables6 {
			removeCiliumRules(t, "ip6tables")
		}
	}

	for _, c := range ciliumChains {
		c.remove()
	}
}
45633
func hasMultipleMounts() (bool, error) {
	num := 0

	mountInfos, err := mountinfo.GetMountInfo()
	if err != nil {
		return false, err
	}

	for _, mountInfo := range mountInfos {
		if mountInfo.Root == "/" && mountInfo.MountPoint == mapRoot {
			num++
		}
	}

	return num > 1, nil
}
920149
func (fs *Filters) removeFromTopicMatchers(watcher *Filter) {
	delete(fs.allTopicsMatcher, watcher)
	for _, topic := range watcher.Topics {
		delete(fs.topicMatcher[BytesToTopic(topic)], watcher)
	}
}
1309105
func (c *Client) RemoveAll(name string) error {
	err := delete(c, name, true)
	if os.IsNotExist(err) {
		return nil
	}

	return err
}
751548
func RemoveAll(fs VFS, path string) error {
	stat, err := fs.Lstat(path)
	if err != nil {
		if err == os.ErrNotExist {
			return nil
		}
		return err
	}
	if stat.IsDir() {
		files, err := fs.ReadDir(path)
		if err != nil {
			return err
		}
		for _, v := range files {
			filePath := pathpkg.Join(path, v.Name())
			if err := RemoveAll(fs, filePath); err != nil {
				return err
			}
		}
	}
	return fs.Remove(path)
}
272096
func (s *Bucket) DeleteMultipleObjects(input *DeleteMultipleObjectsInput) (*DeleteMultipleObjectsOutput, error) {
	r, x, err := s.DeleteMultipleObjectsRequest(input)

	if err != nil {
		return x, err
	}

	err = r.Send()
	if err != nil {
		return nil, err
	}

	requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
	x.RequestID = &requestID

	return x, err
}
508063
func (s *Service) UnsubscribeMultiple(topics []string) GenericFuture {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	// remove subscription
	for _, v := range topics {
		s.subscriptions.Empty(v)
	}

	// allocate future
	f := future.New()

	// queue unsubscribe
	s.commandQueue <- &command{
		unsubscribe: true,
		future:      f,
		topics:      topics,
	}

	return f
}
1020448
func RemoveAll() {
	mutex.Lock()
	defer mutex.Unlock()
	endpointid.ReallocatePool()
	endpoints = map[uint16]*endpoint.Endpoint{}
	endpointsAux = map[string]*endpoint.Endpoint{}
}