Date: Wed, 27 Oct 2021 06:42:33 +0000 From: Alexey Dokuchaev <danfe@freebsd.org> To: Piotr Kubaj <pkubaj@freebsd.org> Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Subject: Re: git: 981564583497 - main - net/cjdns: fix build on powerpc64* Message-ID: <YXj02W6rRXC0ZSTA@FreeBSD.org> In-Reply-To: <202110261848.19QImqrt031580@gitrepo.freebsd.org> References: <202110261848.19QImqrt031580@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 26, 2021 at 06:48:52PM +0000, Piotr Kubaj wrote: > commit 9815645834977fe2ada5052d3c81881b7624bed7 > > net/cjdns: fix build on powerpc64* > > On powerpc64 and powerpc64le systems, os.cpus(), gets defined to []: > > cpus = os.cpus() > [] > > It has type object: > > typeof cpus > 'object' > > This causes jobs to be 0: > > Math.floor((typeof cpus === 'undefined' ? 1 : cpus.length) * 1.25); > 0 > > Change it so that instead of comparing type to undefined, we compare to 0: > > Math.floor((os.cpus() == 0 ? 1 : cpus.length) * 1.25); Wouldn't os.cpus() == [] be more correct^Wreadable? On a related note, JavaScript is horrible language, don't write in it. Pro tip: if some $lang has === operator, it's highly likely that it is just as bad. ./danfe
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YXj02W6rRXC0ZSTA>