From 3a5a9f51fcd2b38e343183912bcffaad4e634a67 Mon Sep 17 00:00:00 2001 From: Saxon Milton Date: Sun, 3 Dec 2017 19:44:24 +1030 Subject: [PATCH] Fixed some var names --- ringbuffer/RingBuffer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ringbuffer/RingBuffer.go b/ringbuffer/RingBuffer.go index 983b37ad..3492b0c1 100644 --- a/ringbuffer/RingBuffer.go +++ b/ringbuffer/RingBuffer.go @@ -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