CPU: Simplify format check

This commit is contained in:
Dylan Araps 2016-12-14 11:45:33 +11:00
parent f7686ee8e8
commit dc08df12ac

View file

@ -862,11 +862,8 @@ get_cpu() {
;;
esac
# Format the output
case "$os" in
"Mac OS X" | "iPhone OS") ;;
*)
# Fix for speeds under 1ghz
if [[ "$speed" ]]; then
if [[ -z "${speed:1}" ]]; then
speed="0.${speed}"
else
@ -874,14 +871,10 @@ get_cpu() {
fi
cpu="$cpu @ ${speed}GHz $temp"
;;
esac
fi
# Remove uneeded patterns from cpu output
# This is faster than sed/gsub
cpu="${cpu//(tm)}"
cpu="${cpu//(TM)}"
cpu="${cpu//(r)}"
cpu="${cpu//(R)}"
cpu="${cpu//CPU}"
cpu="${cpu//Processor}"