Second Round CURL Wrapper Review

jdrewsen jdrewsen at nospam.com
Tue Dec 13 12:43:24 PST 2011


On Monday, 12 December 2011 at 14:42:17 UTC, Andrei Alexandrescu 
wrote:
> On 12/12/11 6:25 AM, jdrewsen wrote:
>> On Monday, 12 December 2011 at 01:05:25 UTC, Jonathan M Davis 
>> wrote:
>>> On Sunday, December 11, 2011 19:55:28 dsimcha wrote:
>>>> On 12/11/2011 7:53 PM, dsimcha wrote:
>>>> > Should the protocol detection be case-insensitive, i.e. > 
>>>> > "ftp://" ==
>>>> > "FTP://"?
>>>>
>>>> Oh, one more thing: Factor the protocol detection out into a 
>>>> function.
>>>> You have the same expression cut and pasted everywhere:
>>>>
>>>> if(url.startsWith("ftp://") || url.startsWith("ftps://") ...
>>>
>>> And startsWith will take multiple arguments, so the code 
>>> definitely
>>> shouldn't have
>>>
>>> x.startsWith(y) || x.startsWith(z) || ...
>>>
>>> It's more verbose and less efficient that way.
>>>
>>> - Jonathan M Davis
>>
>> I hadn't noticed that multiple arguments is accepted. Thanks.
>> /Jonas
>
> You can also pass a predicate for case insensitive comparison.
>
> Andrei

Perfect



More information about the Digitalmars-d mailing list