Quieten deadcode

This commit is contained in:
kortschak 2014-08-28 12:04:45 +09:30
parent 484bf145a8
commit 8118c8d3cc
11 changed files with 25 additions and 37 deletions

View file

@ -42,24 +42,16 @@ type Fixed struct {
type Equality func(a, b graph.Value) bool
// Define an equality function of purely ==, which works for native types.
func BasicEquality(a, b graph.Value) bool {
if a == b {
return true
}
return false
func Identity(a, b graph.Value) bool {
return a == b
}
// Creates a new Fixed iterator based around == equality.
func newFixed() *Fixed {
return NewFixedIteratorWithCompare(BasicEquality)
}
// Creates a new Fixed iterator with a custom comparitor.
func NewFixedIteratorWithCompare(compareFn Equality) *Fixed {
// Creates a new Fixed iterator with a custom comparator.
func NewFixed(cmp Equality) *Fixed {
return &Fixed{
uid: NextUID(),
values: make([]graph.Value, 0, 20),
cmp: compareFn,
cmp: cmp,
}
}
@ -88,7 +80,7 @@ func (it *Fixed) TagResults(dst map[string]graph.Value) {
}
func (it *Fixed) Clone() graph.Iterator {
out := NewFixedIteratorWithCompare(it.cmp)
out := NewFixed(it.cmp)
for _, val := range it.values {
out.Add(val)
}