Removed TODO; slightly faster SharedWriter commit.
diff --git a/reader.go b/reader.go
index 460e0cf..4ffda19 100644
--- a/reader.go
+++ b/reader.go
@@ -38,7 +38,7 @@
if lower <= upper {
this.consumer.Consume(lower, upper)
- this.read.Store(upper) // TODO: make this cheaper if possible, e.g. LazyStore?
+ this.read.Store(upper)
previous = upper
} else if upper = this.written.Load(); lower <= upper {
// Gating--TODO: wait strategy (provide gating count to wait strategy for phased backoff)
diff --git a/shared_writer.go b/shared_writer.go
index b4a280e..c7f7996 100644
--- a/shared_writer.go
+++ b/shared_writer.go
@@ -43,7 +43,8 @@
// POTENTIAL TODO: start from upper and work toward lower
// this may have the effect of keeping a batch together which
// might otherwise be split up...
- for shift, mask := this.shift, this.mask; lower <= upper; lower++ {
- this.committed[lower&mask] = int32(lower >> shift)
+ for lower <= upper {
+ this.committed[lower&this.mask] = int32(lower >> this.shift)
+ lower++
}
}