mirror of https://github.com/jimsalterjrs/sanoid
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:
parent
09b42d6ade
commit
603c286b50
5
syncoid
5
syncoid
|
|
@ -1541,11 +1541,8 @@ sub getsnaps() {
|
||||||
$snap =~ s/^.*\@(.*)\tguid.*$/$1/;
|
$snap =~ s/^.*\@(.*)\tguid.*$/$1/;
|
||||||
$snaps{$type}{$snap}{'guid'}=$guid;
|
$snaps{$type}{$snap}{'guid'}=$guid;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
foreach my $line (@rawsnaps) {
|
|
||||||
# only import snap creations from the specified filesystem
|
# only import snap creations from the specified filesystem
|
||||||
if ($line =~ /\Q$fs\E\@.*creation/) {
|
elsif ($line =~ /\Q$fs\E\@.*creation/) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
my $creation = $line;
|
my $creation = $line;
|
||||||
$creation =~ s/^.*\tcreation\t*(\d*).*/$1/;
|
$creation =~ s/^.*\tcreation\t*(\d*).*/$1/;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue