Permalink
Browse files

move WalkRefs to valueImpl (#3762)

  • Loading branch information...
rafael-atticlabs committed Oct 12, 2017
1 parent d693bcd commit 7900255447c23b43e5f3b204a9abc8aaa292337a
Showing with 4 additions and 19 deletions.
  1. +0 −3 go/types/blob_leaf_sequence.go
  2. +0 −4 go/types/leaf_sequence.go
  3. +0 −4 go/types/meta_sequence.go
  4. +0 −4 go/types/ref.go
  5. +0 −4 go/types/struct.go
  6. +4 −0 go/types/value.go
@@ -50,9 +50,6 @@ func (bl blobLeafSequence) getItem(idx int) sequenceItem {
return bl.buff[offset]
}
func (bl blobLeafSequence) WalkRefs(cb RefCallback) {
}
func (bl blobLeafSequence) typeOf() *Type {
return BlobType
}
@@ -138,10 +138,6 @@ func (seq leafSequence) getItem(idx int) sequenceItem {
return dec.readValue()
}
func (seq leafSequence) WalkRefs(cb RefCallback) {
walkRefs(seq.valueBytes(), cb)
}
func (seq leafSequence) Len() uint64 {
return seq.numLeaves()
}
@@ -255,10 +255,6 @@ func (ms metaSequence) valuesSlice(from, to uint64) []Value {
panic("meta sequence")
}
func (ms metaSequence) WalkRefs(cb RefCallback) {
walkRefs(ms.valueBytes(), cb)
}
func (ms metaSequence) typeOf() *Type {
dec, count := ms.decoderSkipToValues()
ts := make(typeSlice, count)
View
@@ -118,10 +118,6 @@ func (r Ref) Value() Value {
func (r Ref) WalkValues(cb ValueCallback) {
}
func (r Ref) WalkRefs(cb RefCallback) {
cb(r)
}
func (r Ref) typeOf() *Type {
return makeCompoundType(RefKind, r.TargetType())
}
View
@@ -136,10 +136,6 @@ func (s Struct) WalkValues(cb ValueCallback) {
}
}
func (s Struct) WalkRefs(cb RefCallback) {
walkRefs(s.valueBytes(), cb)
}
func (s Struct) typeOf() *Type {
dec := s.decoder()
return readStructTypeOfValue(&dec)
View
@@ -143,6 +143,10 @@ func (v valueImpl) Less(other Value) bool {
return valueLess(v, other)
}
func (v valueImpl) WalkRefs(cb RefCallback) {
walkRefs(v.valueBytes(), cb)
}
type asValueImpl interface {
asValueImpl() valueImpl
}

0 comments on commit 7900255

Please sign in to comment.