Don't iterate over snaps twice

Process snapshots in one pass rather than looping separately for both
guid and create time.
This commit is contained in:
Vinnie Okada 2021-11-20 13:09:10 -07:00
parent 09b42d6ade
commit 603c286b50
1 changed files with 1 additions and 4 deletions

View File

@ -1541,11 +1541,8 @@ sub getsnaps() {
$snap =~ s/^.*\@(.*)\tguid.*$/$1/;
$snaps{$type}{$snap}{'guid'}=$guid;
}
}
foreach my $line (@rawsnaps) {
# only import snap creations from the specified filesystem
if ($line =~ /\Q$fs\E\@.*creation/) {
elsif ($line =~ /\Q$fs\E\@.*creation/) {
chomp $line;
my $creation = $line;
$creation =~ s/^.*\tcreation\t*(\d*).*/$1/;