cross returns the cross product of s and t.
(t stringSet, isSuffix bool)
| 836 | |
| 837 | // cross returns the cross product of s and t. |
| 838 | func (s stringSet) cross(t stringSet, isSuffix bool) stringSet { |
| 839 | p := stringSet{} |
| 840 | for _, ss := range s { |
| 841 | for _, tt := range t { |
| 842 | p.add(ss + tt) |
| 843 | } |
| 844 | } |
| 845 | p.clean(isSuffix) |
| 846 | return p |
| 847 | } |
| 848 | |
| 849 | // clear empties the set but preserves the storage. |
| 850 | func (s *stringSet) clear() { |