Skip to content

Commit

Permalink
issue 174
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Oct 7, 2024
1 parent 5e0bcef commit 43e8b4d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bitset.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,16 @@ func From(buf []uint64) *BitSet {
return FromWithLength(uint(len(buf))*64, buf)
}

// FromWithLength constructs from an array of words and length.
// FromWithLength constructs from an array of words and length in bits.
// This function is for advanced users, most users should prefer
// the From function.
// As a user of FromWithLength, you are responsible for ensuring
// that the length is correct: your slice should have length at
// least (len+63)/64 in 64-bit words.
func FromWithLength(len uint, set []uint64) *BitSet {
if uint(len(set)) < wordsNeeded(len) {

Check failure on line 116 in bitset.go

View workflow job for this annotation

GitHub Actions / test (1.16.x, ubuntu-latest)

cannot call non-function len (type uint)

Check failure on line 116 in bitset.go

View workflow job for this annotation

GitHub Actions / test (1.18.x, ubuntu-latest)

invalid operation: cannot call non-function len (variable of type uint)

Check failure on line 116 in bitset.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, ubuntu-latest)

invalid operation: cannot call non-function len (variable of type uint)

Check failure on line 116 in bitset.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

invalid operation: cannot call non-function len (variable of type uint)

Check failure on line 116 in bitset.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, macos-latest)

invalid operation: cannot call non-function len (variable of type uint)

Check failure on line 116 in bitset.go

View workflow job for this annotation

GitHub Actions / test (1.18.x, ubuntu-latest)

invalid operation: cannot call non-function len (variable of type uint)

Check failure on line 116 in bitset.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, ubuntu-latest)

invalid operation: cannot call non-function len (variable of type uint)

Check failure on line 116 in bitset.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

invalid operation: cannot call non-function len (variable of type uint)
panic("BitSet.FromWithLength: slice is too short")
}
return &BitSet{len, set}
}

Expand Down

0 comments on commit 43e8b4d

Please sign in to comment.