On 07/19/2013 10:40 AM, anonymous wrote:

> On Friday, 19 July 2013 at 17:18:00 UTC, JS wrote:

>>             for(int j = 0; j < s.length - d.length; j++)
>
> This j would shadow the one above. Just choose another name.

Even better:

    foreach (k; 0 .. s.length - d.length)

or:

    foreach (k; iota(s.length - d.length))

Also, either code must deal with the case where d.length is greater than s.length. Otherwise, being a size_t, the subtraction will be a large value.

Ali

Reply via email to