state: use addNamespaceIndex again

This commit is contained in:
Daniel Nephin 2021-03-29 13:01:31 -04:00
parent d38b04e96b
commit 150decff2a
1 changed files with 6 additions and 0 deletions

View File

@ -101,6 +101,12 @@ const null = "\x00"
// indexBuilder is a buffer used to construct memdb index values.
type indexBuilder bytes.Buffer
func newIndexBuilder(cap int) *indexBuilder {
buff := make([]byte, 0, cap)
b := bytes.NewBuffer(buff)
return (*indexBuilder)(b)
}
// String appends the string and a null terminator to the buffer.
func (b *indexBuilder) String(v string) {
(*bytes.Buffer)(b).WriteString(v)