1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

MidiLogger Demo: Avoid redrawing when no new messages have been received

This commit is contained in:
reuk 2021-10-20 20:14:13 +01:00
parent 420167f3ec
commit 6b8d07a0f6
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -80,6 +80,9 @@ public:
template <typename It>
void addMessages (It begin, It end)
{
if (begin == end)
return;
const auto numNewMessages = (int) std::distance (begin, end);
const auto numToAdd = juce::jmin (numToStore, numNewMessages);
const auto numToRemove = jmax (0, (int) messages.size() + numToAdd - numToStore);