From 0a6e8468cc55956077598b145001a03d4bd225b8 Mon Sep 17 00:00:00 2001 From: phanium Date: Thu, 4 Apr 2024 22:27:37 +0800 Subject: [PATCH] Avoid invoking extra subshell in `__fish_md5` --- share/functions/__fish_md5.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_md5.fish b/share/functions/__fish_md5.fish index 3ad1a46f3..58e33a1ec 100644 --- a/share/functions/__fish_md5.fish +++ b/share/functions/__fish_md5.fish @@ -3,12 +3,12 @@ function __fish_md5 # GNU systems if set -q argv[2] if test $argv[1] = -s - echo (echo $argv[2] | md5sum | string split ' ')[1] + echo $argv[2] | md5sum | string split ' ' -f 1 else printf (_ "%s: Too many arguments %s\n") fish_md5 $argv >&2 end else - echo (md5sum $argv[1] | string split ' ')[1] + md5sum $argv[1] | string split ' ' -f 1 end return 0 else if type -q md5