Fixed some var names

This commit is contained in:
Saxon Milton 2017-12-03 19:44:24 +10:30
parent 89b4468f6c
commit 3a5a9f51fc
1 changed files with 4 additions and 4 deletions

View File

@ -54,17 +54,17 @@ type ringBuffer struct {
New returns the addres of a new ring buffer with the parameters specified.
It initialises fields and allocates the required dataMemory.
*/
func NewRingBuffer(size int, elementSize int) (rb *ringBuffer) {
func NewRingBuffer(bufferSize int, elementSize int) (rb *ringBuffer) {
if size <= 0 || elementSize <= 0 {
return nil
}
rb = new(ringBuffer)
rb.dataMemory = make([][]byte, size)
rb.dataMemory = make([][]byte, bufferSize)
for i := range rb.dataMemory {
rb.dataMemory[i] = make([]byte, elementSize)
}
rb.sizeMemory = make([]int, size)
rb.size = size
rb.size = bufferSize
rb.noOfElements = 0
rb.first = -1
rb.last = -1
@ -115,7 +115,7 @@ func (rb *ringBuffer) DoneWriting(size int) error {
if rb.last == rb.size {
rb.last = 0
}
rb.sizeMemory[rb.last] = size
rb.sizeMemory[rb.last] = size
rb.noOfElements++
rb.currentlyWriting = false
return nil