From 9b12e4fe6f3c95986f1f3ec791636c58ca7e7583 Mon Sep 17 00:00:00 2001 From: Jake Champlin Date: Fri, 9 Jun 2017 17:54:32 +0000 Subject: Transfer of provider code --- vendor/github.com/hashicorp/terraform/dag/set.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vendor/github.com/hashicorp/terraform/dag') diff --git a/vendor/github.com/hashicorp/terraform/dag/set.go b/vendor/github.com/hashicorp/terraform/dag/set.go index 3929c9d..92b4215 100644 --- a/vendor/github.com/hashicorp/terraform/dag/set.go +++ b/vendor/github.com/hashicorp/terraform/dag/set.go @@ -81,6 +81,20 @@ func (s *Set) Difference(other *Set) *Set { return result } +// Filter returns a set that contains the elements from the receiver +// where the given callback returns true. +func (s *Set) Filter(cb func(interface{}) bool) *Set { + result := new(Set) + + for _, v := range s.m { + if cb(v) { + result.Add(v) + } + } + + return result +} + // Len is the number of items in the set. func (s *Set) Len() int { if s == nil { -- cgit v1.2.3