Skip to content

Commit 8cbc818

Browse files
Fix IsEmpty() methode
1 parent c5250f9 commit 8cbc818

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

api/RingBuffer.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*
2-
RingBuffer.h - Ring buffer implementation
32
Copyright (c) 2014 Arduino. All right reserved.
43
54
This library is free software; you can redistribute it and/or
@@ -9,8 +8,8 @@
98
109
This library is distributed in the hope that it will be useful,
1110
but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13-
Lesser General Public License for more details.
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
1413
1514
You should have received a copy of the GNU Lesser General Public
1615
License along with this library; if not, write to the Free Software
@@ -56,7 +55,7 @@ class RingBufferN
5655

5756
private:
5857
int nextIndex(int index);
59-
inline bool isEmpty() const { return (_numElems == 0); }
58+
inline bool isEmpty() const { return (0 == available()); }
6059
};
6160

6261
typedef RingBufferN<SERIAL_BUFFER_SIZE> RingBuffer;

0 commit comments

Comments
 (0)