Skip to content

Commit ded5959

Browse files
committed
Merge pull request #5 from canni/master
Small arithmetic simplification
2 parents d1df561 + 334cc1b commit ded5959

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

queue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ func (q *Queue) resize() {
3535
if q.tail > q.head {
3636
copy(newBuf, q.buf[q.head:q.tail])
3737
} else {
38-
copy(newBuf, q.buf[q.head:len(q.buf)])
39-
copy(newBuf[len(q.buf)-q.head:], q.buf[:q.tail])
38+
n := copy(newBuf, q.buf[q.head:])
39+
copy(newBuf[n:], q.buf[:q.tail])
4040
}
4141

4242
q.head = 0

0 commit comments

Comments
 (0)