refactor(storage): remove dead HoleGranularityCoarse helper#89
Merged
Conversation
…w finding) HoleGranularityCoarse had no production caller — both D3 guard sites (read-side overlaySparseDiff, creation-side snapshotsDirCoarse) call holeGranularityFn/ ProbeHoleGranularity directly because they need the granularity value g for their diagnostics, not the bool. The only references were two redundant test assertions (each already covered by the direct g/err assertion above it). holeGranularityFn (the production-used, test-injectable seam) is retained. build/vet/storage tests green.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe exported ChangesHole granularity probing
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
D3 리뷰(PR #88)에서 발견한 dead code 정리:
storage.HoleGranularityCoarse헬퍼를 제거한다. behavior 변경 없음.근거
HoleGranularityCoarse(dir) bool은 production 호출자가 0이었다 — D3 가드 두 곳(판독측overlaySparseDiff, 창설측snapshotsDirCoarse)은 진단 메시지에 granularity 값g가 필요해holeGranularityFn/ProbeHoleGranularity를 직접 호출하고 predicate(err != nil || g > HoleGranularityFine)를 inline으로 적용한다. bool 헬퍼는 그 자리에 맞지 않는다. 유일한 참조는 테스트의 중복 assertion 2건(각각 바로 위의 직접g/errassertion이 이미 커버) — 함께 제거해도 커버리지 손실 없음.변경
internal/storage/hole_granularity.go:HoleGranularityCoarse함수 제거.holeGranularityFn(production 사용 + 테스트 주입 seam,snapshot.go:437)은 유지, doc 갱신.internal/storage/hole_granularity_test.go: 중복HoleGranularityCoarseassertion 2건 제거(직접g/errassertion으로 대체 주석).검증
go build ./...OK,go vetOK,go test ./internal/storage/PASS,gofmt -l .empty. lifecycle: Lightweight(dead-code 제거, behavior/contract 무변경, 1-2 파일).Summary by CodeRabbit
Bug Fixes
Refactor