[Performance] Use awk's comparison to save a pipe to grep

Peter Dave Hello 2017-03-20 04:50:32 +08:00 committed by Jordan Harband
parent 6cb12b0f99
commit 316c9f34c6
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 1 additions and 3 deletions

4
nvm.sh
View File

@ -1181,9 +1181,7 @@ nvm_get_checksum() {
SHASUMS_URL="${MIRROR}/${3}/SHASUMS.txt"
fi
nvm_download -L -s "${SHASUMS_URL}" -o - | \
nvm_grep "${4}.tar.${5}" | \
command awk '{print $1}'
nvm_download -L -s "${SHASUMS_URL}" -o - | command awk "{ if (\"${4}.tar.${5}\" == \$2) print \$1}"
}
nvm_checksum() {