From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: "Douglas A. Gwyn" Message-ID: <3EB9EA8C.40001@null.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit References: <20030501160047.7231.qmail@g.bio.cse.psu.edu>, <20030507124006.D26796@cackle.proxima.alt.za> Subject: Re: [9fans] same functions everywhere Date: Thu, 8 May 2003 09:08:27 +0000 Topicbox-Message-UUID: a3579f0a-eacb-11e9-9e20-41e7f4b1d025 Lucio De Re wrote: > while (x < 100 && a[x] != v) { Of course there is a well-known "kludge" when the array has been allocated with an extra slot that can be safely written: a[100] = v; // sentinel while (a[x] != v) { which speeds the loop up. The obvious test at the end distinguishes between "found" and "not found". I'm not suggesting fine-grained exceptions for such application unless tightly integrated into the language. For Standard C at present we seem to be limited to using setjmp/longjmp, which has too much overhead on most platforms.