]> Sergey Matveev's repositories - btrtrc.git/commit
Inlineable reader.Seek and no-lock return for bad whence (#577)
authorYenForYang <YenForYang@users.noreply.github.com>
Mon, 13 Sep 2021 12:52:58 +0000 (07:52 -0500)
committerGitHub <noreply@github.com>
Mon, 13 Sep 2021 12:52:58 +0000 (22:52 +1000)
commit5332d3e9d45cd13d86d34c362a3059bde46a8d90
tree155df44a84da237b8d2ce81f14908aab84c8923e
parent134eea84180e9856c6f1c62b73f37168f836a1fb
Inlineable reader.Seek and no-lock return for bad whence (#577)

* Inlineable reader.Seek and no-lock return for bad whence

Couldn't find an elegant way to early exit on bad whence. Using a closure could reduce code duplication slightly, but it's overkill for only 3 cases.

Note that returning 0 on an invalid whence is the behavior of `strings.Reader` and `bytes.Reader`.

* Update reader.go
reader.go