Checking if a string is null
derek at psyc.ward
Thu Jul 26 00:39:02 PDT 2007
On Thu, 26 Jul 2007 09:28:16 +0200, Frits van Bommel wrote:
> Derek Parnell wrote:
>> On Thu, 26 Jul 2007 07:50:07 +0200, Frits van Bommel wrote:
>>> Derek Parnell wrote:
>>>> On Wed, 25 Jul 2007 14:29:47 +0100, Regan Heath wrote:
>>>>> Aside: If the location and length are identical you can short-circuit
>>>>> the compare, returning true and ignoring the content, this could save a
>>>>> bit of time on comparisons of large arrays.
> I'm sorry, but what would then be the problem with accessing
> (cast(byte)4)[0..4] if it's a valid memory location?
Duh! I am so stupid! I misread Regan's original post. When he said "If
the location and length are identical" I incorrectly read that as "if an
array's location and length are identical" and not "if the locations and
lengths of two arrays are identical".
Sorry (as he sulks off hoping no one notices) ...
"Down with mediocrity!"
More information about the Digitalmars-d-learn