Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
Temp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flrnull committed Jun 13, 2013
1 parent bf3cbcb commit e50ce8d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,19 @@ void Result::topUrlTryToAdd(std::string urlMapKey, int count, Config * config) {
for(int j = 0; (j < topCount) && !isAdded; j++) {
std::advance(itRes, j);
// If current value bigger than in top we add it
if (count >= itRes->second) {
if ((count >= itRes->second) || (topCount < config->topUrlsLimit)) {
if (config->debugMode) {
Debug::print("Result::topUrlTryToAdd: " + urlMapKey + " count is bigger");
}
Result::topUrlMap[urlMapKey] = count;
topCount++;
isAdded = true;
} else {
if (config->debugMode) {
Debug::print("Result::topUrlTryToAdd: count is smaller");
Debug::print(count);
Debug::print(itRes->second);
}
}
}
// If topUrl exceed limit we should remove the smallest
Expand Down

0 comments on commit e50ce8d

Please sign in to comment.