Skip to content

Commit

Permalink
rename wnd api specific varNameIterator to wapiVarNameIterator
Browse files Browse the repository at this point in the history
reflecting its link to the windows api
  • Loading branch information
0x5a17ed committed Jul 7, 2022
1 parent 9d1dd04 commit cd5f8f3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions efi/efivario/context_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ func (e *bufferVarEntry) ReadFrom(r io.Reader) (n int64, err error) {
return
}

type varNameIterator struct {
type wapiVarNameIterator struct {
buf *bytes.Buffer
current *VariableNameItem
err error
}

func (it *varNameIterator) Close() error {
func (it *wapiVarNameIterator) Close() error {
return nil
}

func (it *varNameIterator) Iter() itkit.Iterator[VariableNameItem] {
func (it *wapiVarNameIterator) Iter() itkit.Iterator[VariableNameItem] {
return it
}

func (it *varNameIterator) Next() bool {
func (it *wapiVarNameIterator) Next() bool {
var entry bufferVarEntry
if _, err := entry.ReadFrom(it.buf); err != nil {
if !errors.Is(err, io.EOF) && errors.Is(err, io.ErrUnexpectedEOF) {
Expand All @@ -84,11 +84,11 @@ func (it *varNameIterator) Next() bool {
return true
}

func (it *varNameIterator) Value() VariableNameItem {
func (it *wapiVarNameIterator) Value() VariableNameItem {
return *it.current
}

func (it *varNameIterator) Err() error {
func (it *wapiVarNameIterator) Err() error {
return it.err
}

Expand Down Expand Up @@ -132,7 +132,7 @@ func (c WindowsContext) VariableNames() (VariableNameIterator, error) {
return nil, err
}

return &varNameIterator{buf: bytes.NewBuffer(buf)}, nil
return &wapiVarNameIterator{buf: bytes.NewBuffer(buf)}, nil
}

func (c WindowsContext) GetSizeHint(name string, guid efiguid.GUID) (int64, error) {
Expand Down

0 comments on commit cd5f8f3

Please sign in to comment.