Proposal for SentinelInputRange
Walter Bright
newshound2 at digitalmars.com
Wed Feb 27 23:22:20 PST 2013
On 2/27/2013 10:02 PM, deadalnix wrote:
> On Thursday, 28 February 2013 at 05:28:47 UTC, Walter Bright wrote:
>> On 2/27/2013 9:20 PM, deadalnix wrote:
>>> If the range define empty with something like front == sentinel, the inliner
>>> should kick in a reduce the whole stuff to only one read, no ?
>>
>> auto c = front;
>> if (c == sentinel || c == XX)
>>
>> is two reads. This may not seem important, but when you want high speed, it
>> can halve it.
>
> Don't you have to check for both all the time ? You have to check for the
> sentinel anyway.
I suggest again taking a look at the dmd source lexer.c for how to do it. There
is no extra check.
More information about the Digitalmars-d
mailing list