lib9p

Go 9P library.
Log | Files | Refs | LICENSE

commit 9106fd2c51dcec175b04e44611d88921f9b6369c
parent 64d44b1bf45854d510808f0a39db016691dcf9ca
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Fri, 29 Dec 2023 09:37:55 +0900

rename variable

Diffstat:
Mfid.go | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fid.go b/fid.go @@ -61,29 +61,29 @@ func newFidPool() *FidPool { } } -func (pool *FidPool) lookup(fid uint32) (*fid, bool) { +func (pool *FidPool) lookup(id uint32) (*fid, bool) { pool.lock.Lock() defer pool.lock.Unlock() - f, ok := pool.m[fid] + f, ok := pool.m[id] return f, ok } -func (pool *FidPool) add(fid uint32) (*fid, error) { +func (pool *FidPool) add(id uint32) (*fid, error) { pool.lock.Lock() defer pool.lock.Unlock() - if _, ok := pool.m[fid]; ok { + if _, ok := pool.m[id]; ok { return nil, fmt.Errorf("fid already in use.") } - f := newFid(fid) - pool.m[fid] = f + f := newFid(id) + pool.m[id] = f return f, nil } -func (pool *FidPool) delete(fid uint32) { +func (pool *FidPool) delete(id uint32) { pool.lock.Lock() defer pool.lock.Unlock() - delete(pool.m, fid) + delete(pool.m, id) } func (pool *FidPool) String() string {