Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: AwsomeStation LoRaBaseStation LoRaTerminal
Revision 6:790344151d69, committed 2016-09-03
- Comitter:
- rba90
- Date:
- Sat Sep 03 05:41:23 2016 +0000
- Parent:
- 5:021f688bfdaa
- Child:
- 7:3e06927ef5ec
- Commit message:
- fix a bug where size_t is always positive
Changed in this revision
| RingBuffer.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RingBuffer.cpp Fri Sep 02 03:23:04 2016 +0000
+++ b/RingBuffer.cpp Sat Sep 03 05:41:23 2016 +0000
@@ -100,27 +100,13 @@
template <typename T>
T CircularBuffer<T>::first()
{
- if (read_ptr > 0)
- {
- return data[read_ptr - 1];
- }
- else
- {
- return data[read_ptr];
- }
+ return data[read_ptr];
}
template <typename T>
T CircularBuffer<T>::last()
{
- if (write_ptr > 0)
- {
- return data[write_ptr - 1];
- }
- else
- {
- return data[write_ptr];
- }
+ return data[write_ptr];
}
template <typename T>