about summary refs log tree commit diff
path: root/perl/lib/Nix/CopyClosure.pm
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-24T10·24+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-24T10·24+0200
commit56131a2709d76a1e52bada83a083bd2cfee2f716 (patch)
tree7c0fc13a112606244d82e76bc489e34d98bbc2c0 /perl/lib/Nix/CopyClosure.pm
parent01ddf53ee9ff77cbd7fc659740279a6ba80fbdae (diff)
Refactor
Diffstat (limited to 'perl/lib/Nix/CopyClosure.pm')
-rw-r--r--perl/lib/Nix/CopyClosure.pm8
1 files changed, 1 insertions, 7 deletions
diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm
index f701a7c8a0d5..061a15c071cf 100644
--- a/perl/lib/Nix/CopyClosure.pm
+++ b/perl/lib/Nix/CopyClosure.pm
@@ -27,13 +27,7 @@ sub copyToOpen {
 
     # Get back the set of paths that are already valid on the remote host.
     my %present;
-    my $n = readInt($from);
-    while ($n--) {
-        my $len = readInt($from);
-        my $s = readN($len, $from);
-        $present{$s} = 1;
-        readN(8 - $len % 8, $from) if $len % 8; # skip padding
-    }
+    $present{$_} = 1 foreach readStrings($from);
 
     my @missing = grep { !$present{$_} } @closure;
     return if !@missing;