Skip to content

Commit c4f4633

Browse files
committed
chore: update API comments after PR mxschmitt#12 changed input to generic arrays
1 parent 3a0377e commit c4f4633

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Go Report Card](https://goreportcard.com/badge/github.com/mxschmitt/golang-combinations)](https://goreportcard.com/report/github.com/mxschmitt/golang-combinations)
77
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
88

9-
This package provides a method to generate all ordered combinations out of a given string array.
9+
This package provides a method to generate all ordered combinations out of a given generic array.
1010
This essentially creates the powerset of the given array except that the empty set is disregarded.
1111

1212
## Examples

combinations.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Package combinations provides a method to generate all combinations out of a given string array.
1+
// Package combinations provides a method to generate all combinations out of a given generic array.
22
package combinations
33

44
import "math/bits"
55

6-
// All returns all combinations for a given string array.
6+
// All returns all combinations for a given generic array.
77
// This is essentially a powerset of the given set except that the empty set is disregarded.
88
func All[T any](set []T) (subsets [][]T) {
99
length := uint(len(set))
@@ -27,7 +27,7 @@ func All[T any](set []T) (subsets [][]T) {
2727
return subsets
2828
}
2929

30-
// Combinations returns combinations of n elements for a given string array.
30+
// Combinations returns combinations of n elements for a given generic array.
3131
// For n < 1, it equals to All and returns all combinations.
3232
func Combinations[T any](set []T, n int) (subsets [][]T) {
3333
length := uint(len(set))

0 commit comments

Comments
 (0)