Skip to content

Commit

Permalink
spelling error
Browse files Browse the repository at this point in the history
  • Loading branch information
git committed Jun 16, 2023
1 parent 7b8e448 commit e1826c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,14 @@ func (seg *segment) readInternal(blockNumber uint32, chunkOffset int64) ([]byte,
copy(header, block[chunkOffset:chunkOffset+chunkHeaderSize])

// length
legnth := binary.LittleEndian.Uint16(header[4:6])
length := binary.LittleEndian.Uint16(header[4:6])

// copy data
start := chunkOffset + chunkHeaderSize
result = append(result, block[start:start+int64(legnth)]...)
result = append(result, block[start:start+int64(length)]...)

// check sum
checksumEnd := chunkOffset + chunkHeaderSize + int64(legnth)
checksumEnd := chunkOffset + chunkHeaderSize + int64(length)
checksum := crc32.ChecksumIEEE(block[chunkOffset+4 : checksumEnd])
savedSum := binary.LittleEndian.Uint32(header[:4])
if savedSum != checksum {
Expand Down

0 comments on commit e1826c7

Please sign in to comment.