From f6b024e157d3aecf364894a1b24f1e51504b0e18 Mon Sep 17 00:00:00 2001 From: YenForYang Date: Mon, 13 Sep 2021 23:05:37 -0500 Subject: [PATCH] Inlineable (*reader).SetReadAhead and (*reader).Close (#594) Small fixes that prevent inlining of public functions --- reader.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reader.go b/reader.go index 53833e37..3b407ce3 100644 --- a/reader.go +++ b/reader.go @@ -70,10 +70,10 @@ func (r *reader) SetNonResponsive() { func (r *reader) SetReadahead(readahead int64) { r.mu.Lock() - defer r.mu.Unlock() r.readahead = readahead r.readaheadFunc = nil r.posChanged() + r.mu.Unlock() } // How many bytes are available to read. Max is the most we could require. @@ -248,8 +248,8 @@ func (r *reader) readOnceAt(ctx context.Context, b []byte, pos int64) (n int, er // Hodor func (r *reader) Close() error { r.t.cl.lock() - defer r.t.cl.unlock() r.t.deleteReader(r) + r.t.cl.unlock() return nil }