iterate over the list, decreasing each url's rank this is very naive, but a 1..30 for loop is acceptable (i hope)
| 183 | // iterate over the list, decreasing each url's rank |
| 184 | // this is very naive, but a 1..30 for loop is acceptable (i hope) |
| 185 | void PopularUrls::decreaseRanks() |
| 186 | { |
| 187 | if (head) { |
| 188 | UrlNodeP p = head; |
| 189 | while (p) { |
| 190 | if (p->rank - DECREASE >= 0) |
| 191 | p->rank -= DECREASE; |
| 192 | else |
| 193 | p->rank = 0; |
| 194 | p = p->next; |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | // removes a node from the list, but doesn't free memory! |
| 200 | // note: this will be buggy in case the list becomes empty (which should never happen) |
nothing calls this directly
no outgoing calls
no test coverage detected