Skip to content

Incorrect comments about key length in MemTable #1281

@Xuecmbm

Description

@Xuecmbm
  1. ​​Incorrect comment in MemTable::Get​​
// entry format is:
//    klength  varint32
//    userkey  char[klength]   // ← Problem here
//    tag      uint64
//    vlength  varint32
//    value    char[vlength]

Fix: userkey char[klength - 8].

  1. ​​Incorrect comment in MemTable::Add​​
  // Format of an entry is concatenation of:
  //  key_size     : varint32 of internal_key.size()
  //  key bytes    : char[internal_key.size()]   // ← Problem here
  //  tag          : uint64((sequence << 8) | type)
  //  value_size   : varint32 of value.size()
  //  value bytes  : char[value.size()]

Fix: key bytes : char[key.size()] .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions