Skip to content

Commit

Permalink
Renamed Lenght to Length everywhere 🗿 (#201)
Browse files Browse the repository at this point in the history
Co-authored-by: quackable <matsveimaksimau@nb-pg77059hj9.barn-sun.ts.net>
  • Loading branch information
OS-M and quackable authored Jun 14, 2024
1 parent 6766a26 commit 3595f52
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions functions/sequence_using.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import "github.com/elliotchance/pie/pie/util"
// others params will be ignored
func (ss SliceType) SequenceUsing(creator func(int) ElementType, params ...int) SliceType {
var seq = func(min, max, step int) (seq SliceType) {
lenght := int(util.Round(float64(max-min) / float64(step)))
if lenght < 1 {
length := int(util.Round(float64(max-min) / float64(step)))
if length < 1 {
return
}

seq = make(SliceType, lenght)
for i := 0; i < lenght; min += step {
seq = make(SliceType, length)
for i := 0; i < length; min += step {
seq[i] = creator(min)
i++
}
Expand Down
8 changes: 4 additions & 4 deletions pie/carpointers_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,13 @@ func (ss carPointers) Send(ctx context.Context, ch chan<- *car) carPointers {
// others params will be ignored
func (ss carPointers) SequenceUsing(creator func(int) *car, params ...int) carPointers {
var seq = func(min, max, step int) (seq carPointers) {
lenght := int(util.Round(float64(max-min) / float64(step)))
if lenght < 1 {
length := int(util.Round(float64(max-min) / float64(step)))
if length < 1 {
return
}

seq = make(carPointers, lenght)
for i := 0; i < lenght; min += step {
seq = make(carPointers, length)
for i := 0; i < length; min += step {
seq[i] = creator(min)
i++
}
Expand Down
8 changes: 4 additions & 4 deletions pie/cars_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,13 @@ func (ss cars) Send(ctx context.Context, ch chan<- car) cars {
// others params will be ignored
func (ss cars) SequenceUsing(creator func(int) car, params ...int) cars {
var seq = func(min, max, step int) (seq cars) {
lenght := int(util.Round(float64(max-min) / float64(step)))
if lenght < 1 {
length := int(util.Round(float64(max-min) / float64(step)))
if length < 1 {
return
}

seq = make(cars, lenght)
for i := 0; i < lenght; min += step {
seq = make(cars, length)
for i := 0; i < length; min += step {
seq[i] = creator(min)
i++
}
Expand Down
8 changes: 4 additions & 4 deletions pie/float64s_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,13 +779,13 @@ func (ss Float64s) Sequence(params ...int) Float64s {
// others params will be ignored
func (ss Float64s) SequenceUsing(creator func(int) float64, params ...int) Float64s {
var seq = func(min, max, step int) (seq Float64s) {
lenght := int(util.Round(float64(max-min) / float64(step)))
if lenght < 1 {
length := int(util.Round(float64(max-min) / float64(step)))
if length < 1 {
return
}

seq = make(Float64s, lenght)
for i := 0; i < lenght; min += step {
seq = make(Float64s, length)
for i := 0; i < length; min += step {
seq[i] = creator(min)
i++
}
Expand Down
8 changes: 4 additions & 4 deletions pie/ints_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,13 +779,13 @@ func (ss Ints) Sequence(params ...int) Ints {
// others params will be ignored
func (ss Ints) SequenceUsing(creator func(int) int, params ...int) Ints {
var seq = func(min, max, step int) (seq Ints) {
lenght := int(util.Round(float64(max-min) / float64(step)))
if lenght < 1 {
length := int(util.Round(float64(max-min) / float64(step)))
if length < 1 {
return
}

seq = make(Ints, lenght)
for i := 0; i < lenght; min += step {
seq = make(Ints, length)
for i := 0; i < length; min += step {
seq[i] = creator(min)
i++
}
Expand Down
8 changes: 4 additions & 4 deletions pie/strings_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,13 @@ func (ss Strings) Send(ctx context.Context, ch chan<- string) Strings {
// others params will be ignored
func (ss Strings) SequenceUsing(creator func(int) string, params ...int) Strings {
var seq = func(min, max, step int) (seq Strings) {
lenght := int(util.Round(float64(max-min) / float64(step)))
if lenght < 1 {
length := int(util.Round(float64(max-min) / float64(step)))
if length < 1 {
return
}

seq = make(Strings, lenght)
for i := 0; i < lenght; min += step {
seq = make(Strings, length)
for i := 0; i < length; min += step {
seq[i] = creator(min)
i++
}
Expand Down
8 changes: 4 additions & 4 deletions template.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions v2/sequence_using.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import "math"
// others params will be ignored
func SequenceUsing[T any](ss []T, creator func(int) T, params ...int) []T {
var seq = func(min, max, step int) (seq []T) {
lenght := int(math.Round(float64(max-min) / float64(step)))
if lenght < 1 {
length := int(math.Round(float64(max-min) / float64(step)))
if length < 1 {
return
}

seq = make([]T, lenght)
for i := 0; i < lenght; min += step {
seq = make([]T, length)
for i := 0; i < length; min += step {
seq[i] = creator(min)
i++
}
Expand Down

0 comments on commit 3595f52

Please sign in to comment.