MCPcopy Create free account
hub / github.com/dolthub/doltgresql / removeNilGenerators

Function removeNilGenerators

testing/generation/utils/statement_generator.go:755–766  ·  view source on GitHub ↗

removeNilGenerators returns a new slice of generators with all nils removed.

(gens []StatementGenerator)

Source from the content-addressed store, hash-verified

753
754// removeNilGenerators returns a new slice of generators with all nils removed.
755func removeNilGenerators(gens []StatementGenerator) []StatementGenerator {
756 newGens := make([]StatementGenerator, 0, len(gens))
757 for i := range gens {
758 if gens[i] != nil {
759 newGens = append(newGens, gens[i])
760 }
761 }
762 if len(newGens) == 0 {
763 return nil
764 }
765 return newGens
766}

Callers 4

aggregateMethod · 0.85
AddChildrenMethod · 0.85
copyGeneratorsFunction · 0.85
sourceGeneratorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected