MCPcopy Index your code
hub / github.com/google/codesearch / clean

Method clean

index/regexp.go:780–795  ·  view source on GitHub ↗

clean removes duplicates from the stringSet.

(isSuffix bool)

Source from the content-addressed store, hash-verified

778
779// clean removes duplicates from the stringSet.
780func (s *stringSet) clean(isSuffix bool) {
781 t := *s
782 if isSuffix {
783 sort.Sort((*bySuffix)(s))
784 } else {
785 sort.Sort((*byPrefix)(s))
786 }
787 w := 0
788 for _, str := range t {
789 if w == 0 || t[w-1] != str {
790 t[w] = str
791 w++
792 }
793 }
794 *s = t[:w]
795}
796
797// size returns the number of strings in s.
798func (s stringSet) size() int {

Callers 5

andTrigramsMethod · 0.95
unionMethod · 0.95
crossMethod · 0.95
simplifyMethod · 0.80
simplifySetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected