code: func (info *regexpInfo) simplifySet(s *stringSet) {
  	t := *s
  	t.clean(s == &info.suffix)
  
  	// Add the OR of the current prefix/suffix set to the query.
  	info.match = info.match.andTrigrams(t)
  
  	for n := 3; n == 3 || t.size() > maxSet; n-- {
  		// Replace set by strings of length n-1.
  		w := 0
  		for _, str := range t {
  			if len(str) >= n {
  				if s == &info.prefix {
  					str = str[:n-1]
  				} else {
  					str = str[len(str)-n+1:]
  				}
  			}
  			if w == 0 || t[w-1] != str {
  				t[w] = str
  				w++
  			}
  		}
  		t = t[:w]
  		t.clean(s == &info.suffix)
  	}
  
  	// Now make sure that the prefix/suffix sets aren't redundant.
  	// For example, if we know "ab" is a possible prefix, then it
  	// doesn't help at all to know that  "abc" is also a possible
  	// prefix, so delete "abc".
  	w := 0
  	f := strings.HasPrefix
  	if s == &info.suffix {
  		f = strings.HasSuffix
  	}
  	for _, str := range t {
  		if w == 0 || !f(str, t[w-1]) {
  			t[w] = str
  			w++
  		}
  	}
  	t = t[:w]
  
  	*s = t
  }
docs: // simplifySet reduces the size of the given set (either prefix or suffix).
  // There is no need to pass around enormous prefix or suffix sets, since
  // they will only be used to create trigrams.  As they get too big, simplifySet
  // moves the information they contain into the match query, which is
  // more efficient to pass around.