MCPcopy Create free account
hub / github.com/KDE/krusader / decreaseRanks

Method decreaseRanks

app/Dialogs/popularurls.cpp:185–197  ·  view source on GitHub ↗

iterate over the list, decreasing each url's rank this is very naive, but a 1..30 for loop is acceptable (i hope)

Source from the content-addressed store, hash-verified

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)
185void 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)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected