Second Round CURL Wrapper Review
jdrewsen
jdrewsen at nospam.com
Mon Dec 12 04:25:36 PST 2011
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
More information about the Digitalmars-d
mailing list