From c1578391cc2089cd224fd8325c333038e0ba7b7b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 31 Mar 2023 18:01:47 -0600 Subject: maps: Add HasKey and HaveAnyKeysInCommon functions, use them --- cmd/btrfs-rec/inspect/rebuildmappings/process.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/btrfs-rec/inspect/rebuildmappings') 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] -- cgit v1.2.3-2-g168b