// comparator will either create a new ruler filter and add its filter
439890
func (rf *RulerRule) compare(comp int, value interface{}) *RulerRule {
	var comparator string
	switch comp {
	case eq:
		comparator = "eq"
	case neq:
		comparator = "neq"
	case lt:
		comparator = "lt"
	case lte:
		comparator = "lte"
	case gt:
		comparator = "gt"
	case gte:
		comparator = "gte"
	case contains:
		comparator = "contains"
	case matches:
		comparator = "matches"
	case ncontains:
		comparator = "ncontains"
	}

	// if this thing has a comparator already, we need to make a new ruler filter
	if rf.Comparator != "" {
		rf = &RulerRule{
			rf.Ruler,
			&Rule{
				comparator,
				rf.Path,
				value,
			},
		}
		// attach the new filter to the ruler
		rf.Ruler.rules = append(rf.Ruler.rules, rf.Rule)
	} else {
		//if there is no comparator, we can just set things on the current filter
		rf.Comparator = comparator
		rf.Value = value
	}

	return rf
}
328578
func MapKeySeparator(sep rune) Option {
	return func(ini *INI) error {
		ini.mapkeySep = sep
		return nil
	}
}
130644
func Ordered(platforms ...specs.Platform) MatchComparer {
	matchers := make([]Matcher, len(platforms))
	for i := range platforms {
		matchers[i] = NewMatcher(platforms[i])
	}
	return orderedPlatformComparer{
		matchers: matchers,
	}
}
1299603
func SeparatorsToIndexEqual(o1, o2 *SeparatorsToIndexOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
83073
func (s *ExpectedAttributeValue) SetComparisonOperator(v string) *ExpectedAttributeValue {
	s.ComparisonOperator = &v
	return s
}
1265299
func (s *BehaviorCriteria) SetComparisonOperator(v string) *BehaviorCriteria {
	s.ComparisonOperator = &v
	return s
}
873172
func (s *Sample) Sort() *Sample {
	if s.Sorted || sort.Float64sAreSorted(s.Xs) {
		// All set
	} else if s.Weights == nil {
		sort.Float64s(s.Xs)
	} else {
		sort.Sort(&sampleSorter{s.Xs, s.Weights})
	}
	s.Sorted = true
	return s
}
419363
func (o *OptionalFiltersOption) Equal(o2 *OptionalFiltersOption) bool {
	return o.comp.Equal(&o2.comp)
}
1242317
func (s *PutScalingPolicyInput) SetComparisonOperator(v string) *PutScalingPolicyInput {
	s.ComparisonOperator = &v
	return s
}
431148
func NewRegexStringComparator(pattern string, patternFlags int32,
	charset, engine string) *RegexStringComparator {
	return &RegexStringComparator{
		Pattern:      proto.String(pattern),
		PatternFlags: proto.Int32(patternFlags),
		Charset:      proto.String(charset),
		Engine:       proto.String(engine),
	}
}
656580
func AsRecordComparator(comparators []RecordComparator) RecordComparator {
	return func(l, r Record) bool {
		for _, c := range comparators {
			if c(l, r) {
				return true
			} else if c(r, l) {
				return false
			}
		}
		return false
	}

}
643561
func Sorter(v interface{}) sort.Interface {
	switch v := v.(type) {
	case []int:
		return sort.IntSlice(v)
	case []float64:
		return sort.Float64Slice(v)
	case []string:
		return sort.StringSlice(v)
	case []time.Time:
		return sortTimeSlice(v)
	case sort.Interface:
		return v
	}

	rv := reflectSlice(v)
	switch rv.Type().Elem().Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return sortIntSlice{rv}
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		return sortUintSlice{rv}
	case reflect.Float32, reflect.Float64:
		return sortFloatSlice{rv}
	case reflect.String:
		return sortStringSlice{rv}
	}
	panic(&generic.TypeError{rv.Type().Elem(), nil, "is not orderable"})
}
1035206
func (s *SkipList) GetGreaterOrEqual(min interface{}) (actualKey, value interface{}, ok bool) {
	candidate := s.getPath(s.header, nil, min)

	if candidate != nil {
		return candidate.key, candidate.value, true
	}
	return nil, nil, false
}
90196
func (p *SortKeys) AsRecordComparators() []RecordComparator {
	numeric := utils.NewIndex(p.Numeric)
	reverseIndex := utils.NewIndex(p.Reversed)
	comparators := make([]RecordComparator, len(p.Keys))
	for i, k := range p.Keys {
		k := k
		if numeric.Contains(k) {
			comparators[i] = func(l, r Record) bool {
				return LessNumericStrings(l.Get(k), r.Get(k))
			}
		} else {
			comparators[i] = func(l, r Record) bool {
				return LessStrings(l.Get(k), r.Get(k))
			}
		}
		if reverseIndex.Contains(k) {
			f := comparators[i]
			comparators[i] = func(l, r Record) bool {
				return !f(l, r)
			}
		}
	}
	return comparators
}
807028
func (s *Condition) SetComparisonOperator(v string) *Condition {
	s.ComparisonOperator = &v
	return s
}
357643
func (s *MetricAlarm) SetComparisonOperator(v string) *MetricAlarm {
	s.ComparisonOperator = &v
	return s
}
710474
func (s *QualificationRequirement) SetComparator(v string) *QualificationRequirement {
	s.Comparator = &v
	return s
}