* sort the alternate in descending order based on the cost */
| 82 | * sort the alternate in descending order based on the cost |
| 83 | */ |
| 84 | void WordAltList::Sort() { |
| 85 | for (int alt_idx = 0; alt_idx < alt_cnt_; alt_idx++) { |
| 86 | for (int alt = alt_idx + 1; alt < alt_cnt_; alt++) { |
| 87 | if (alt_cost_[alt_idx] > alt_cost_[alt]) { |
| 88 | char_32 *pchTemp = word_alt_[alt_idx]; |
| 89 | word_alt_[alt_idx] = word_alt_[alt]; |
| 90 | word_alt_[alt] = pchTemp; |
| 91 | |
| 92 | int temp = alt_cost_[alt_idx]; |
| 93 | alt_cost_[alt_idx] = alt_cost_[alt]; |
| 94 | alt_cost_[alt] = temp; |
| 95 | |
| 96 | void *tag = alt_tag_[alt_idx]; |
| 97 | alt_tag_[alt_idx] = alt_tag_[alt]; |
| 98 | alt_tag_[alt] = tag; |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | void WordAltList::PrintDebug() { |
| 105 | for (int alt_idx = 0; alt_idx < alt_cnt_; alt_idx++) { |
no outgoing calls
no test coverage detected