Inlineable (*reader).SetReadAhead and (*reader).Close (#594)

Small fixes that prevent inlining of public functions
This commit is contained in:
YenForYang 2021-09-13 23:05:37 -05:00 committed by GitHub
parent a8db640c62
commit f6b024e157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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
}