Home | History | Annotate | Download | only in scripts

Lines Matching refs:alternatives

62     def score(self, alternatives):
63 return -sum([len(list(count)) ** 2 for _, count in itertools.groupby(sorted(alternatives))])
99 alternatives = list(set([c.identifier[pos] for c in cases]))
100 alternatives.sort()
113 self.write_selection(expression, alternatives, literal, response)
119 def write_selection(self, expression, alternatives, literal, response):
120 if len(alternatives) == 1:
121 self.output_file.write(u'if (LIKELY(%s == %s)) {\n' % (expression, literal(alternatives[0])))
122 response(alternatives[0])
124 elif len(alternatives) == 2:
125 self.output_file.write(u'if (%s == %s) {\n' % (expression, literal(alternatives[0])))
126 response(alternatives[0])
127 self.output_file.write(u'} else if (LIKELY(%s == %s)) {\n' % (expression, literal(alternatives[1])))
128 response(alternatives[1])
132 for alternative in alternatives: