clarify a few of the TODO comments

This commit is contained in:
Travis 2020-05-19 13:50:48 -05:00
parent 4b4fd590ca
commit 631d3deeed
No known key found for this signature in database
GPG key ID: 37080CC2042BA34E
2 changed files with 14 additions and 5 deletions

View file

@ -36,7 +36,10 @@ func NewBTreeBitmap(a ...uint64) *Bitmap {
b := &Bitmap{
Containers: newBTreeContainers(),
}
// TODO: We have no way to report this.
// We have no way to report this.
// Because we just created Bitmap, its OpWriter is nil, so there
// is no code path which would cause Add() to return an error.
// Therefore, it's safe to swallow this error.
_, _ = b.Add(a...)
return b
}

View file

@ -207,9 +207,12 @@ func NewBitmap(a ...uint64) *Bitmap {
b := &Bitmap{
Containers: newSliceContainers(),
}
// TODO: We have no way to report this. We aren't in a server context
// We have no way to report this. We aren't in a server context
// so we haven't got a logger, nothing is checking for nil returns
// from this...
// from this.
// Because we just created Bitmap, its OpWriter is nil, so there
// is no code path which would cause AddN() to return an error.
// Therefore, it's safe to swallow this error.
_, _ = b.AddN(a...)
return b
}
@ -222,9 +225,12 @@ func NewSliceBitmap(a ...uint64) *Bitmap {
b := &Bitmap{
Containers: newSliceContainers(),
}
// TODO: We have no way to report this. We aren't in a server context
// We have no way to report this. We aren't in a server context
// so we haven't got a logger, nothing is checking for nil returns
// from this...
// from this.
// Because we just created Bitmap, its OpWriter is nil, so there
// is no code path which would cause AddN() to return an error.
// Therefore, it's safe to swallow this error.
_, _ = b.AddN(a...)
return b
}