Remove redundant conditionals

Whenever the `sysctl` call does not match `"Apple"*`, we can be sure
that `HOMEBREW_PROCESSOR` is `Intel`, so there's no need for this
additional check.
This commit is contained in:
Carlo Cabrera 2021-11-11 16:24:59 +08:00
parent 51ab1649fb
commit fd1ca7e2b7
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -14,8 +14,7 @@ VENDOR_DIR="${HOMEBREW_LIBRARY}/Homebrew/vendor"
# Built from https://github.com/Homebrew/homebrew-portable-ruby.
if [[ -n "${HOMEBREW_MACOS}" ]]
then
if [[ "${HOMEBREW_PROCESSOR}" == "Intel" &&
"$(sysctl -n machdep.cpu.brand_string)" != "Apple"* ]] ||
if [[ "$(sysctl -n machdep.cpu.brand_string)" != "Apple"* ]] ||
# Handle the case where /usr/local/bin/brew is run under arm64.
# It's a x86_64 installation there (we refuse to install arm64 binaries) so
# use a x86_64 Portable Ruby.