Skip to content

Commit

Permalink
Removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Sep 16, 2022
1 parent 06f0a3d commit 1c3c926
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
8 changes: 0 additions & 8 deletions modules/engine/attributevalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ func (nv NoValues) Len() int {
return 0
}

func AttributeValueSliceFromStrings(values []string) AttributeValueSlice {
var result AttributeValueSlice
for _, av := range values {
result = append(result, AttributeValueString(av))
}
return result
}

type AttributeValueSlice []AttributeValue

func (avs AttributeValueSlice) First() AttributeValue {
Expand Down
39 changes: 0 additions & 39 deletions modules/engine/attributevaluemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package engine

type AttributeValueMap struct {
m map[Attribute]AttributeValues
// firstattribute Attribute
// data []AttributeValues
}

func (avm AttributeValueMap) Get(a Attribute) (av AttributeValues, found bool) {
Expand All @@ -12,53 +10,23 @@ func (avm AttributeValueMap) Get(a Attribute) (av AttributeValues, found bool) {
}
av, found = avm.m[a]
return
// if a < avm.firstattribute || int(a-avm.firstattribute) >= len(avm.data) {
// return nil, false
// }
// result := avm.data[a-avm.firstattribute]
// return result, result != nil
}

func (avm *AttributeValueMap) Set(a Attribute, av AttributeValues) {
if avm.m == nil {
avm.m = make(map[Attribute]AttributeValues)
}
avm.m[a] = av
// if len(avm.data) == 0 {
// avm.firstattribute = a
// avm.data = make([]AttributeValues, 1)
// avm.data[0] = av
// } else if a < avm.firstattribute {
// shift := int(avm.firstattribute - a)
// newdata := make([]AttributeValues, len(avm.data)+shift, len(avm.data)+shift)
// copy(newdata[shift:], avm.data)
// avm.data = newdata
// avm.firstattribute = a
// } else if int(a-avm.firstattribute) >= len(avm.data) {
// add := int(a-avm.firstattribute) - len(avm.data) + 1
// newdata := make([]AttributeValues, len(avm.data)+add, len(avm.data)+add)
// copy(newdata, avm.data)
// avm.data = newdata
// }
// avm.data[a-avm.firstattribute] = av
}

func (avm AttributeValueMap) Len() int {
return len(avm.m)
// var count int
// for _, v := range avm.data {
// if v != nil {
// count++
// }
// }
// return count
}

func (avm *AttributeValueMap) Clear(a Attribute) {
if avm.m != nil {
delete(avm.m, a)
}
// avm.data[a-avm.firstattribute] = nil
}

func (avm AttributeValueMap) Iterate(f func(attr Attribute, values AttributeValues) bool) {
Expand All @@ -67,11 +35,4 @@ func (avm AttributeValueMap) Iterate(f func(attr Attribute, values AttributeValu
break
}
}
// for i, values := range avm.data {
// if values != nil {
// if !f(avm.firstattribute+Attribute(i), values) {
// break
// }
// }
// }
}

0 comments on commit 1c3c926

Please sign in to comment.