metabase: Move cheaper conditions to the front in ListWithCursor()
Some checks failed
DCO action / DCO (pull_request) Failing after 41s
Pre-commit hooks / Pre-commit (pull_request) Successful in 3m0s
Vulncheck / Vulncheck (pull_request) Successful in 2m49s
Build / Build Components (pull_request) Successful in 3m30s
Tests and linters / Staticcheck (pull_request) Successful in 5m3s
Tests and linters / gopls check (pull_request) Successful in 6m2s
Tests and linters / Run gofumpt (pull_request) Successful in 6m21s
Tests and linters / Lint (pull_request) Successful in 6m54s
Tests and linters / Tests with -race (pull_request) Successful in 7m49s
Tests and linters / Tests (pull_request) Successful in 7m54s
Some checks failed
DCO action / DCO (pull_request) Failing after 41s
Pre-commit hooks / Pre-commit (pull_request) Successful in 3m0s
Vulncheck / Vulncheck (pull_request) Successful in 2m49s
Build / Build Components (pull_request) Successful in 3m30s
Tests and linters / Staticcheck (pull_request) Successful in 5m3s
Tests and linters / gopls check (pull_request) Successful in 6m2s
Tests and linters / Run gofumpt (pull_request) Successful in 6m21s
Tests and linters / Lint (pull_request) Successful in 6m54s
Tests and linters / Tests with -race (pull_request) Successful in 7m49s
Tests and linters / Tests (pull_request) Successful in 7m54s
`objectLocked` call is expensive, it does IO. We may omit it if object is not expired. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
a49f0717b3
commit
8554214ff1
1 changed files with 1 additions and 1 deletions
|
@ -251,7 +251,7 @@ func selectNFromBucket(bkt *bbolt.Bucket, // main bucket
|
|||
}
|
||||
|
||||
expEpoch, hasExpEpoch := hasExpirationEpoch(&o)
|
||||
if !objectLocked(bkt.Tx(), cnt, obj) && hasExpEpoch && expEpoch < currEpoch {
|
||||
if hasExpEpoch && expEpoch < currEpoch && !objectLocked(bkt.Tx(), cnt, obj) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue