Skip to content

Commit ac37679

Browse files
authored
Prettify DetectAll recognizerOutputs slice (#8)
1 parent 4b6791f commit ac37679

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

detector.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (d *Detector) DetectAll(b []byte) ([]Result, error) {
9999
for _, r := range d.recognizers {
100100
go matchHelper(r, input, outputChan)
101101
}
102-
outputs := make([]recognizerOutput, 0, len(d.recognizers))
102+
outputs := make(recognizerOutputs, 0, len(d.recognizers))
103103
for i := 0; i < len(d.recognizers); i++ {
104104
o := <-outputChan
105105
if o.Confidence > 0 {
@@ -110,7 +110,7 @@ func (d *Detector) DetectAll(b []byte) ([]Result, error) {
110110
return nil, NotDetectedError
111111
}
112112

113-
sort.Sort(recognizerOutputs(outputs))
113+
sort.Sort(outputs)
114114
dedupOutputs := make([]Result, 0, len(outputs))
115115
foundCharsets := make(map[string]struct{}, len(outputs))
116116
for _, o := range outputs {

0 commit comments

Comments
 (0)