Friday, October 11, 2024

pkg_outdated wasted memory

Index: pkg_outdated
===================================================================
RCS file: /cvs/ports/infrastructure/bin/pkg_outdated,v
diff -u -p -u -p -r1.8 pkg_outdated
--- pkg_outdated 23 May 2023 08:48:03 -0000 1.8
+++ pkg_outdated 12 Oct 2024 00:17:12 -0000
@@ -107,9 +107,8 @@ sub collect_port_versions($pkg, $portsdi
next;
}
$port->{$subdir}{name} = $_;
- my ($stem, $version) = OpenBSD::PackageName::splitname($_);
- $port->{$subdir}{stem} = $stem;
- $port->{$subdir}{version} = $version;
+ ($port->{$subdir}{stem}, $port->{$subdir}{version})
+ = OpenBSD::PackageName::splitname($_);
}
close($fh);
$state->progress->next;
Hi,

In the universe's grand scheme of things the wasted memory, garbage collection and cpu cycles doesn't mean much.

The patch removes variable allocation in a while loop that is not needed.

Ian McWilliam

No comments:

Post a Comment