From 107d63dc2cca5b2a78d6c2607a21222541771548 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 5 Jan 2023 05:53:35 +0300 Subject: [PATCH] Update documentation --- scdb/internal/buffers/buffer.go | 4 ++-- scdb/internal/buffers/pool.go | 2 +- scdb/internal/entries/db_file_header.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scdb/internal/buffers/buffer.go b/scdb/internal/buffers/buffer.go index d6eb944..0de78d6 100644 --- a/scdb/internal/buffers/buffer.go +++ b/scdb/internal/buffers/buffer.go @@ -19,7 +19,7 @@ type Buffer struct { RightOffset uint64 } -// NewBuffer creates a new Buffer with the given left_offset +// NewBuffer creates a new Buffer with the given leftOffset // FIXME: Add test for this func NewBuffer(leftOffset uint64, data []byte, capacity uint64) *Buffer { upperBound := uint64(math.Min(float64(len(data)), float64(capacity))) @@ -50,7 +50,7 @@ func (b *Buffer) Contains(addr uint64) bool { // // It is possible for data appended to this buffer to make it exceed // its capacity. However, after that Buffer.CanAppend will always return false -// So make sure you call `can_append()` always. +// So make sure you call `canAppend()` always. // This is a trade-off that allows us to limit the number of re-allocations for buffers func (b *Buffer) Append(data []byte) uint64 { dataLength := len(data) diff --git a/scdb/internal/buffers/pool.go b/scdb/internal/buffers/pool.go index f37431f..7286e6d 100644 --- a/scdb/internal/buffers/pool.go +++ b/scdb/internal/buffers/pool.go @@ -387,7 +387,7 @@ func (bp *BufferPool) AddrBelongsToKey(kvAddress uint64, key []byte) (bool, erro } // loop in reverse, starting at the back - // since the latest kv_buffers are the ones updated when new changes occur + // since the latest kvBuffers are the ones updated when new changes occur kvBufLen := len(bp.kvBuffers) for i := kvBufLen - 1; i >= 0; i-- { buf := bp.kvBuffers[i] diff --git a/scdb/internal/entries/db_file_header.go b/scdb/internal/entries/db_file_header.go index 58252d1..0025bb7 100644 --- a/scdb/internal/entries/db_file_header.go +++ b/scdb/internal/entries/db_file_header.go @@ -129,7 +129,7 @@ func (h *DbFileHeader) GetIndexOffset(key []byte) uint64 { return HeaderSizeInBytes + (hash * IndexEntrySizeInBytes) } -// GetIndexOffsetInNthBlock returns the index offset for the nth index block if `initial_offset` is the offset +// GetIndexOffsetInNthBlock returns the index offset for the nth index block if `initialOffset` is the offset // in the top most index block `n` starts at zero where zero is the top most index block func (h *DbFileHeader) GetIndexOffsetInNthBlock(initialOffset uint64, n uint64) (uint64, error) { if n >= h.NumberOfIndexBlocks {