From c0c4e487a8636a3dabd217971b4335087d8f81b2 Mon Sep 17 00:00:00 2001 From: Manish R Jain <manishrjain@gmail.com> Date: Sun, 15 Nov 2015 22:36:46 +1100 Subject: [PATCH] Remove unnecessary functions. --- posting/list.go | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/posting/list.go b/posting/list.go index 767c93af..f574c230 100644 --- a/posting/list.go +++ b/posting/list.go @@ -32,8 +32,6 @@ import ( "github.com/dgraph-io/dgraph/x" "github.com/dgryski/go-farm" "github.com/google/flatbuffers/go" - - linked "container/list" ) var glog = x.Log("posting") @@ -571,37 +569,6 @@ func (l *List) AddMutation(t x.DirectedEdge, op byte) error { return l.clog.AddLog(t.Timestamp.UnixNano(), l.hash, mbuf) } -func addOrSet(ll *linked.List, p *types.Posting) { - added := false - for e := ll.Front(); e != nil; e = e.Next() { - pe := e.Value.(*types.Posting) - if pe == nil { - glog.Fatal("Posting shouldn't be nil!") - } - - if !added && pe.Uid() > p.Uid() { - ll.InsertBefore(p, e) - added = true - - } else if pe.Uid() == p.Uid() { - added = true - e.Value = p - } - } - if !added { - ll.PushBack(p) - } -} - -func remove(ll *linked.List, p *types.Posting) { - for e := ll.Front(); e != nil; e = e.Next() { - pe := e.Value.(*types.Posting) - if pe.Uid() == p.Uid() { - ll.Remove(e) - } - } -} - func (l *List) isDirty() bool { l.RLock() defer l.RUnlock() -- GitLab