MCPcopy
hub / github.com/uber-go/nilaway / add

Function add

assertion/function/functioncontracts/infer.go:525–533  ·  view source on GitHub ↗
(s nilnessTableSet, t nilnessTable)

Source from the content-addressed store, hash-verified

523type nilnessTableSet []nilnessTable
524
525func add(s nilnessTableSet, t nilnessTable) (nilnessTableSet, bool) {
526 // TODO: an efficient check for whether t is already in s.
527 for _, v := range s {
528 if v.equals(t) {
529 return s, false
530 }
531 }
532 return append(s, t), true
533}
534
535func newNilnessTableSet() nilnessTableSet {
536 return make(nilnessTableSet, 0)

Callers 2

inferContractsFunction · 0.85
deriveContractsFunction · 0.85

Calls 1

equalsMethod · 0.65

Tested by

no test coverage detected