Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: standard error codes Date: Tue, 10 Jan 2017 13:03:21 -0800 Organization: None to speak of Lines: 19 Message-ID: References: <96e16709-18eb-4399-86c4-a6f30a767df3@googlegroups.com> <212f08fd-b09e-4848-8485-f7480eaaae45@googlegroups.com> <86260b21-0fa2-42b4-93c6-08e9241d4c17@googlegroups.com> <64011b84-2f8d-44f2-902a-0eacfcdf630b@googlegroups.com> <11823fb6-613e-4283-95e8-dd930e152418@googlegroups.com> <546841f1-b478-44dc-abc0-22ca4f46e553@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="051d99dd7a883013689f38e075ee6474"; logging-data="22461"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gzuHHrRIPW+96qAExrPUZ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:JAPgkfRFZnek6pnml57zLlrUPQo= sha1:MgStwC0j7bcaS/ipxFXW5Ua2qLI= Xref: csiph.com comp.lang.c:101403 Malcolm McLean writes: > On Tuesday, January 10, 2017 at 8:01:26 PM UTC, Keith Thompson wrote: >> >> The question remains, is it significantly more efficient to return >> a zero/nonzero result than a negative/zero/positive result? >> > C++ std::sort is built on a < operator which returns true if a < b, and > has to be called a bit clumsily if(!(a < b) && !( b That gives it a slight benefit over qsort which insists on a three-way > comparison. What "slight benefit" are you referring to? If you mean there's a performance improvement, do you have measurements? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"