From 5cb23e4ce619e6353effb6e5a317fc6b715282c0 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Mon, 5 Aug 2019 17:47:41 -0400 Subject: [PATCH] update-keys: don't restore cwd in a subprocess Using popd at the very end of a shell script is unnecessary, because, as the very last command, there is nothing to restore state for. Immediately after, the shell subprocess is ended, and processes don't control the cwd of the parent process. Changing the cwd for the last microsecond of the shell process, during which no commands are run, is a mildly expensive no-op. By the same measure, if popd is never used, pushd is not needed to record the old cwd. So simply use 'cd'. Signed-off-by: Christian Hesse --- update-keys | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/update-keys b/update-keys index 7482817..d5deb4b 100755 --- a/update-keys +++ b/update-keys @@ -21,7 +21,7 @@ armor no-emit-version __EOF__ -pushd "$(dirname "$0")" >/dev/null +cd "$(dirname "$0")" "${GPG[@]}" --gen-key < archlinux.gpg - -popd >/dev/null