@@ -41,7 +41,7 @@ type ListRange interface {
4141 // Item returns the index and value of the current item in the range. or panics if there is no current item.
4242 // For efficiency, Item may reuse the values returned by previous Item calls. Callers should be careful avoid holding
4343 // pointers to the value returned by Item() that escape the iteration loop since they become invalid once either
44- // Item() or Recycle () is called.
44+ // Item() or Allocator.Free () is called.
4545 Item () (index int , value Value )
4646}
4747
@@ -57,15 +57,13 @@ func (_ *emptyRange) Item() (index int, value Value) {
5757 panic ("Item called on empty ListRange" )
5858}
5959
60- func (_ * emptyRange ) Recycle () {}
61-
6260// ListEquals compares two lists lexically.
6361// WARN: This is a naive implementation, calling lhs.Equals(rhs) is typically the most efficient.
6462func ListEquals (lhs , rhs List ) bool {
65- return listEqualsInto (defaultAllocator , lhs , rhs )
63+ return ListEqualsInto (defaultAllocator , lhs , rhs )
6664}
6765
68- func listEqualsInto (a Allocator , lhs , rhs List ) bool {
66+ func ListEqualsInto (a Allocator , lhs , rhs List ) bool {
6967 if lhs .Length () != rhs .Length () {
7068 return false
7169 }
@@ -78,7 +76,7 @@ func listEqualsInto(a Allocator, lhs, rhs List) bool {
7876 for lhsRange .Next () && rhsRange .Next () {
7977 _ , lv := lhsRange .Item ()
8078 _ , rv := rhsRange .Item ()
81- if ! equalsInto (a , lv , rv ) {
79+ if ! EqualsInto (a , lv , rv ) {
8280 return false
8381 }
8482 }
@@ -93,9 +91,9 @@ func ListLess(lhs, rhs List) bool {
9391// ListCompare compares two lists lexically. The result will be 0 if l==rhs, -1
9492// if l < rhs, and +1 if l > rhs.
9593func ListCompare (lhs , rhs List ) int {
96- return listCompareInto (defaultAllocator , lhs , rhs )
94+ return ListCompareInto (defaultAllocator , lhs , rhs )
9795}
98- func listCompareInto (a Allocator , lhs , rhs List ) int {
96+ func ListCompareInto (a Allocator , lhs , rhs List ) int {
9997 lhsRange := lhs .RangeInto (a )
10098 defer a .Free (lhsRange )
10199 rhsRange := rhs .RangeInto (a )
@@ -118,7 +116,7 @@ func listCompareInto(a Allocator, lhs, rhs List) int {
118116 }
119117 _ , lv := lhsRange .Item ()
120118 _ , rv := rhsRange .Item ()
121- if c := compareInto (a , lv , rv ); c != 0 {
119+ if c := CompareInto (a , lv , rv ); c != 0 {
122120 return c
123121 }
124122 // The items are equal; continue.
0 commit comments