Skip to content

Commit 38f70e9

Browse files
committed
Removed useless counter itemsInBuffer
1 parent 726758f commit 38f70e9

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

serialport.go

-7
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ type serport struct {
4747

4848
isClosingDueToError bool
4949

50-
// counter incremented on queue, decremented on write
51-
itemsInBuffer int
52-
5350
// buffered channel containing up to 25600 outbound messages.
5451
sendBuffered chan string
5552

@@ -224,10 +221,6 @@ func (p *serport) writerNoBuf() {
224221
// if we get here, we were able to write successfully
225222
// to the serial port because it blocks until it can write
226223

227-
// decrement counter
228-
p.itemsInBuffer--
229-
log.Printf("itemsInBuffer:%v\n", p.itemsInBuffer)
230-
231224
// FINALLY, OF ALL THE CODE IN THIS PROJECT
232225
// WE TRULY/FINALLY GET TO WRITE TO THE SERIAL PORT!
233226
n2, err := p.portIo.Write(data)

0 commit comments

Comments
 (0)