X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Ftop10scorescreen.cpp;h=2db7bfd4ecc3c167e309d9c42a20c82db235446a;hp=791c785ec61b4fc0fd30bb5db1bc39a2c6cd809f;hb=5b91be5c8efa7c68e38134630c9894dd6484d72e;hpb=5205061c547014321afc2d00e739c480df49d197 diff --git a/bigscreen/top10scorescreen.cpp b/bigscreen/top10scorescreen.cpp index 791c785..2db7bfd 100644 --- a/bigscreen/top10scorescreen.cpp +++ b/bigscreen/top10scorescreen.cpp @@ -20,7 +20,17 @@ bool Top10ScoreScreen::check_invalidated() if (!scores_changed.get_flag()) return false; - return true; + // check that there are indeed changes, otherwise don't bother + std::vector scores; + conn.perform(FetchTopScoresForTournament(tournament, 10, &scores)); + + for (std::vector::const_iterator i = scores.begin(); i != scores.end(); ++i) { + if (seen_topscore.count(*i) == 0) { + return true; + } + } + + return false; } void Top10ScoreScreen::draw(unsigned char *buf)