Skip to content

Commit b83abfd

Browse files
authored
Merge pull request #2 from peterdough/bogus-counting
Fixes treehouse-projects#5 by making the cards display more standard
2 parents 43e165c + 4d62690 commit b83abfd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/com/teamtreehouse/flashy/services/FlashCardServiceImpl.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ public FlashCard getNextFlashCardBasedOnViews(Map<Long, Long> idToViewCounts) {
6262
continue;
6363
}
6464
Long lowestScore = idToViewCounts.get(leastViewedId);
65-
if (entry.getValue() >= lowestScore) {
66-
break;
65+
if (entry.getValue() < lowestScore) {
66+
leastViewedId = entry.getKey();
6767
}
68-
leastViewedId = entry.getKey();
6968
}
7069
return flashCardRepository.findOne(leastViewedId);
7170
}

0 commit comments

Comments
 (0)