Skip to content

Commit 6086ea7

Browse files
[PR] dylanaraps/neofetch#2074 from bgkillas - very useless code cleanup
Upstream PR: dylanaraps/neofetch#2074 Thanks to @bgkillas Co-authored-by: bgkillas <55570525+bgkillas@users.noreply.github.com>
2 parents 3ff1e38 + e4fecc6 commit 6086ea7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

neofetch

+3-3
Original file line numberDiff line numberDiff line change
@@ -2799,7 +2799,7 @@ get_memory() {
27992799
pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')"
28002800
pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')"
28012801
pages_compressed="${pages_compressed:-0}"
2802-
mem_used="$(((${pages_app} + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024 / 1024))"
2802+
mem_used="$(((pages_app + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024 / 1024))"
28032803
fi
28042804
;;
28052805

@@ -4006,12 +4006,12 @@ get_local_ip() {
40064006
}
40074007

40084008
get_public_ip() {
4009-
if [[ ! -n "$public_ip_host" ]] && type -p dig >/dev/null; then
4009+
if [[ -z "$public_ip_host" ]] && type -p dig >/dev/null; then
40104010
public_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com)"
40114011
[[ "$public_ip" =~ ^\; ]] && unset public_ip
40124012
fi
40134013

4014-
if [[ ! -n "$public_ip_host" ]] && [[ -z "$public_ip" ]] && type -p drill >/dev/null; then
4014+
if [[ -z "$public_ip_host" ]] && [[ -z "$public_ip" ]] && type -p drill >/dev/null; then
40154015
public_ip="$(drill myip.opendns.com @resolver1.opendns.com | \
40164016
awk '/^myip\./ && $3 == "IN" {print $5}')"
40174017
fi

0 commit comments

Comments
 (0)