]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/zclconf/go-cty/cty/set/iterator.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / zclconf / go-cty / cty / set / iterator.go
index f15498e2fee0d6de9997e9b51be4e54e7bf6028b..4a60494f9d6b299d4287beff8248628cb4e2c02d 100644 (file)
@@ -1,36 +1,15 @@
 package set
 
 type Iterator struct {
-       bucketIds []int
-       vals      map[int][]interface{}
-       bucketIdx int
-       valIdx    int
+       vals []interface{}
+       idx  int
 }
 
 func (it *Iterator) Value() interface{} {
-       return it.currentBucket()[it.valIdx]
+       return it.vals[it.idx]
 }
 
 func (it *Iterator) Next() bool {
-       if it.bucketIdx == -1 {
-               // init
-               if len(it.bucketIds) == 0 {
-                       return false
-               }
-
-               it.valIdx = 0
-               it.bucketIdx = 0
-               return true
-       }
-
-       it.valIdx++
-       if it.valIdx >= len(it.currentBucket()) {
-               it.valIdx = 0
-               it.bucketIdx++
-       }
-       return it.bucketIdx < len(it.bucketIds)
-}
-
-func (it *Iterator) currentBucket() []interface{} {
-       return it.vals[it.bucketIds[it.bucketIdx]]
+       it.idx++
+       return it.idx < len(it.vals)
 }