diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-31 18:01:47 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-04 14:08:38 -0600 |
commit | c1578391cc2089cd224fd8325c333038e0ba7b7b (patch) | |
tree | eb003ba90cb0f8b1863167dec670b4ef0f80f29a /cmd/btrfs-rec/inspect/rebuildmappings | |
parent | 1ba83231195ea3b78ce545f4518f70c74819345b (diff) |
maps: Add HasKey and HaveAnyKeysInCommon functions, use them
Diffstat (limited to 'cmd/btrfs-rec/inspect/rebuildmappings')
-rw-r--r-- | cmd/btrfs-rec/inspect/rebuildmappings/process.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/btrfs-rec/inspect/rebuildmappings/process.go b/cmd/btrfs-rec/inspect/rebuildmappings/process.go index 7a49cc6..2e694b5 100644 --- a/cmd/btrfs-rec/inspect/rebuildmappings/process.go +++ b/cmd/btrfs-rec/inspect/rebuildmappings/process.go @@ -38,7 +38,7 @@ func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults ScanDevicesR devIDs := maps.SortedKeys(scanResults) devices := fs.LV.PhysicalVolumes() for _, devID := range devIDs { - if _, ok := devices[devID]; !ok { + if !maps.HasKey(devices, devID) { return fmt.Errorf("device ID %v mentioned in scan results is not part of the filesystem", devID) } devResults := scanResults[devID] |