Better naming.
diff --git a/single_sequencer.go b/single_sequencer.go
index fc410c9..badd5d9 100644
--- a/single_sequencer.go
+++ b/single_sequencer.go
@@ -3,16 +3,16 @@
func (this *SingleProducerSequencer) Next(slotCount int64) int64 {
nextValue := this.pad.Load()
nextSequence := nextValue + slotCount
- wrapPoint := nextSequence - this.ringSize
- cachedGatingSequence := this.pad[cachedGatingSequencePadIndex]
+ wrap := nextSequence - this.ringSize
+ cachedGate := this.pad[cachedGatePadIndex]
- if wrapPoint > cachedGatingSequence || cachedGatingSequence > nextValue {
+ if wrap > cachedGate || cachedGate > nextValue {
minSequence := int64(0)
- for wrapPoint > minSequence {
+ for wrap > minSequence {
minSequence = this.last.Load()
}
- this.pad[cachedGatingSequencePadIndex] = minSequence
+ this.pad[cachedGatePadIndex] = minSequence
}
this.pad.Store(nextSequence)
@@ -26,7 +26,7 @@
func NewSingleProducerSequencer(cursor *Sequence, ringSize int32, last Barrier) *SingleProducerSequencer {
pad := NewSequence()
- pad[cachedGatingSequencePadIndex] = InitialSequenceValue
+ pad[cachedGatePadIndex] = InitialSequenceValue
return &SingleProducerSequencer{
pad: pad,
@@ -43,4 +43,4 @@
last Barrier
}
-const cachedGatingSequencePadIndex = 1
+const cachedGatePadIndex = 1
diff --git a/single_sequencer_test.go b/single_sequencer_test.go
index fbd1727..0e88727 100644
--- a/single_sequencer_test.go
+++ b/single_sequencer_test.go
@@ -14,7 +14,6 @@
for i := int64(0); i < iterations; i++ {
claimed := sequencer.Next(1)
- //consumerSequence[0] = claimed
consumerSequence.Store(claimed)
}
}