Skip to content

Commit

Permalink
Update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fxamacker committed Dec 4, 2023
1 parent b3e41ec commit 5e67357
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,14 +838,14 @@ func (e *inlineCollisionGroup) getElementAndNextKey(
key Value,
) (MapKey, MapValue, MapKey, error) {

// Adjust level and hkey for collision group
// Adjust level and hkey for collision group.
level++
if level > digester.Levels() {
return nil, nil, nil, NewHashLevelErrorf("inline collision group digest level is %d, want <= %d", level, digester.Levels())
}
hkey, _ := digester.Digest(level)

// Search key in collision group with adjusted hkeyPrefix and hkey
// Search key in collision group with adjusted hkeyPrefix and hkey.
// Don't need to wrap error as external error because err is already categorized by elements.Get().
return e.elements.getElementAndNextKey(storage, digester, level, hkey, comparator, key)
}
Expand Down Expand Up @@ -1053,14 +1053,14 @@ func (e *externalCollisionGroup) getElementAndNextKey(
return nil, nil, nil, err
}

// Adjust level and hkey for collision group
// Adjust level and hkey for collision group.
level++
if level > digester.Levels() {
return nil, nil, nil, NewHashLevelErrorf("external collision group digest level is %d, want <= %d", level, digester.Levels())
}
hkey, _ := digester.Digest(level)

// Search key in collision group with adjusted hkeyPrefix and hkey
// Search key in collision group with adjusted hkeyPrefix and hkey.
// Don't need to wrap error as external error because err is already categorized by MapSlab.getElementAndNextKey().
return slab.getElementAndNextKey(storage, digester, level, hkey, comparator, key)
}
Expand Down Expand Up @@ -1485,7 +1485,7 @@ func (e *hkeyElements) getElementAndNextKey(
}

if nk != nil {
// Found next key in element group
// Found next key in element group.
return k, v, nk, nil
}

Expand Down Expand Up @@ -2171,7 +2171,7 @@ func (e *singleElements) getElementAndNextKey(
return k, v, nil, nil

default: // nextIndex > len(e.elems)
// This should never happen
// This should never happen.
return nil, nil, nil, NewUnreachableError()
}
}
Expand Down Expand Up @@ -4094,7 +4094,7 @@ func (m *MapMetaDataSlab) getElementAndNextKey(
return k, v, nil, nil

default: // nextIndex > len(m.childrenHeaders)
// This should never happen
// This should never happen.
return nil, nil, nil, NewUnreachableError()
}
}
Expand Down Expand Up @@ -5722,7 +5722,7 @@ func (i *mutableMapIterator) CanMutate() bool {

func (i *mutableMapIterator) Next() (Value, Value, error) {
if i.nextKey == nil {
// No more elements
// No more elements.
return nil, nil, nil
}

Expand All @@ -5740,7 +5740,7 @@ func (i *mutableMapIterator) Next() (Value, Value, error) {

func (i *mutableMapIterator) NextKey() (Value, error) {
if i.nextKey == nil {
// No more elements
// No more elements.
return nil, nil
}

Expand Down

0 comments on commit 5e67357

Please sign in to comment.