Skip to content

Commit c5b407f

Browse files
authored
Merge pull request #1 from kpfromer/bogus-counting
Fixed issue treehouse-projects#5 by making the cards displayed more standard
2 parents c285257 + 9b964ca commit c5b407f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/main/java/com/teamtreehouse/flashy/controllers/IndexController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public String index(Model model) {
3434
Long totalCount = flashCardService.getCurrentCount();
3535
if (totalCount > MAX_ITEMS_TO_SHOW) {
3636
ctaBuilder.append(" and ");
37-
ctaBuilder.append(totalCount);
37+
ctaBuilder.append(totalCount - MAX_ITEMS_TO_SHOW);
3838
ctaBuilder.append(" more");
3939
}
4040

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

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

0 commit comments

Comments
 (0)