| ... | ... |
@@ -63,13 +63,7 @@ static int cmpchoice(const void *p1, const void *p2) {
|
| 63 | 63 |
double score1 = choices_score[idx1]; |
| 64 | 64 |
double score2 = choices_score[idx2]; |
| 65 | 65 |
|
| 66 |
- if(score1 == score2) |
|
| 67 |
- /* break ties by length of result */ |
|
| 68 |
- return strlen(choices[idx1]) - strlen(choices[idx2]); |
|
| 69 |
- else if(score1 < score2) |
|
| 70 |
- return 1; |
|
| 71 |
- else |
|
| 72 |
- return -1; |
|
| 66 |
+ return score1 - score2; |
|
| 73 | 67 |
} |
| 74 | 68 |
|
| 75 | 69 |
void run_search(char *needle){
|