Skip to content

Commit

Permalink
Remove unused Type function (cayleygraph#631)
Browse files Browse the repository at this point in the history
* Add contributor

* Remove unused code

Remove code that is no longer used after cayleygraph#570
Closes cayleygraph#537
  • Loading branch information
Yannic committed Sep 12, 2017
1 parent b6db1d6 commit 2ef34a4
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 32 deletions.
4 changes: 0 additions & 4 deletions graph/bolt/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,3 @@ func compareTokens(a, b graph.Value) bool {
func (qs *QuadStore) FixedIterator() graph.FixedIterator {
return iterator.NewFixed(compareTokens)
}

func (qs *QuadStore) Type() string {
return QuadStoreType
}
2 changes: 2 additions & 0 deletions graph/bolt2/bolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ type DB struct {
func (db *DB) Type() string {
return Type
}

func (db *DB) Close() error {
return db.DB.Close()
}

func (db *DB) Tx(update bool) (kv.BucketTx, error) {
tx, err := db.DB.Begin(update)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions graph/gaedatastore/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,3 @@ func (qs *QuadStore) QuadDirection(val graph.Value, dir quad.Direction) graph.Va
sub := t.Hash[offset : offset+(quad.HashSize*2)]
return &Token{Kind: nodeKind, Hash: sub}
}

func (qs *QuadStore) Type() string {
return QuadStoreType
}
4 changes: 0 additions & 4 deletions graph/kv/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,6 @@ func (qs *QuadStore) ValueOf(s quad.Value) graph.Value {
return out
}

func (qs *QuadStore) Type() string {
return qs.db.Type()
}

func (qs *QuadStore) QuadDirection(val graph.Value, d quad.Direction) graph.Value {
p, ok := val.(*proto.Primitive)
if !ok {
Expand Down
4 changes: 0 additions & 4 deletions graph/leveldb/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,3 @@ func compareBytes(a, b graph.Value) bool {
func (qs *QuadStore) FixedIterator() graph.FixedIterator {
return iterator.NewFixed(compareBytes)
}

func (qs *QuadStore) Type() string {
return QuadStoreType
}
4 changes: 0 additions & 4 deletions graph/memstore/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,3 @@ func (qs *QuadStore) NodesAllIterator() graph.Iterator {
}

func (qs *QuadStore) Close() error { return nil }

func (qs *QuadStore) Type() string {
return QuadStoreType
}
4 changes: 0 additions & 4 deletions graph/mongo/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,6 @@ func (qs *QuadStore) QuadDirection(in graph.Value, d quad.Direction) graph.Value

// TODO(barakmich): Rewrite bulk loader. For now, iterating around blocks is the way we'll go about it.

func (qs *QuadStore) Type() string {
return QuadStoreType
}

func (qs *QuadStore) getSize(collection string, constraint bson.M) (int64, error) {
var size int
bytes, err := bson.Marshal(constraint)
Expand Down
4 changes: 0 additions & 4 deletions graph/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ type QuadStore interface {
// qs.ValueOf(qs.Quad(id).Get(dir))
//
QuadDirection(id Value, d quad.Direction) Value

// Get the type of QuadStore
//TODO replace this using reflection
Type() string
}

type Options map[string]interface{}
Expand Down
4 changes: 0 additions & 4 deletions graph/sql/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,6 @@ func (qs *QuadStore) QuadDirection(in graph.Value, d quad.Direction) graph.Value
return NodeHash(in.(QuadHashes).Get(d))
}

func (qs *QuadStore) Type() string {
return QuadStoreType
}

func (qs *QuadStore) sizeForIterator(isAll bool, dir quad.Direction, hash NodeHash) int64 {
var err error
if isAll {
Expand Down

0 comments on commit 2ef34a4

Please sign in to comment.