Skip to content

Commit 38432bd

Browse files
mpontilloxlab
authored andcommitted
translator: add convenience function on TipSpecRx to check for a tip
1 parent 2942bd1 commit 38432bd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

translator/translator.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ func (t TipSpecRx) TipAt(i int) Tip {
7171
return t.Default
7272
}
7373

74+
func (t TipSpecRx) HasTip(q Tip) bool {
75+
for _, tip := range t.tips {
76+
if tip.IsValid() && tip == q {
77+
return true
78+
}
79+
}
80+
return false
81+
}
82+
7483
func (t TipSpecRx) Self() Tip {
7584
if t.self.IsValid() {
7685
return t.self

0 commit comments

Comments
 (0)