summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-05 00:35:48 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-05 19:48:18 -0700
commitaf5f03de8052d144027e7ba99000e3196056adce (patch)
tree5c9af458c0f166c21580bdaeb098ac516c75025e
parent3a7a736d1a6dd574a03e31ca7bcde2ea60767fd6 (diff)
rebuildnodes: Speed up treeAugmentQueue.has()
-rw-r--r--lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
index 9a4bfab..ebca2bd 100644
--- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
+++ b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
@@ -495,18 +495,19 @@ func shortenWantKey(wantKey string) string {
func (treeQueue *treeAugmentQueue) has(wantKey string) bool {
if treeQueue != nil {
+ wantKey = shortenWantKey(wantKey)
if treeQueue.zero != nil {
- if _, ok := treeQueue.zero[shortenWantKey(wantKey)]; ok {
+ if _, ok := treeQueue.zero[wantKey]; ok {
return true
}
}
if treeQueue.single != nil {
- if _, ok := treeQueue.single[shortenWantKey(wantKey)]; ok {
+ if _, ok := treeQueue.single[wantKey]; ok {
return true
}
}
if treeQueue.multi != nil {
- if _, ok := treeQueue.multi[shortenWantKey(wantKey)]; ok {
+ if _, ok := treeQueue.multi[wantKey]; ok {
return true
}
}