diff --git a/examples/QueueDuplicates/QueueDuplicates.ino b/examples/QueueDuplicates/QueueDuplicates.ino index 76ab7e0..37d89db 100644 --- a/examples/QueueDuplicates/QueueDuplicates.ino +++ b/examples/QueueDuplicates/QueueDuplicates.ino @@ -6,6 +6,7 @@ This example code is in the public domain. created 3 November 2019 + modified 6 November 2019 by SMFSW */ @@ -64,7 +65,7 @@ void loop() { if (memcmp(&rec, &chk, sizeof(Rec))) { q_push(&q, &rec); } #else // Check the whole queue bool duplicate = false; - for (int j = max(0, (int) (q_getCount(&q) - 1)) ; j > 0 ; j--) + for (int j = (int) q_getCount(&q) - 1 ; j >= 0 ; j--) { Rec chk = {0xffff,0xffff}; q_peekIdx(&q, &chk, j);