[erlang-patches] Re: small patch for tv

Björn Gustavsson bgustavsson@REDACTED
Tue Dec 1 11:24:20 CET 2009


On Tue, Dec 1, 2009 at 8:44 AM, Dmitriy Budashny
<dmitriy.budashny@REDACTED> wrote:
> On Tue, Dec 1, 2009 at 9:00 AM, Max Lapshin <max.lapshin@REDACTED> wrote:
>
>> On Tue, Dec 1, 2009 at 9:43 AM, Dmitriy Budashny

> Btw, yes I can branch from git, made a patch there, send a link. But
> 1) I didn't see any attention before, so I don't know if the other mail will
> be not directing towards /dev/null

Except for obviously wrong or inappropriate patches, we will include
everything in the 'pu' branch. See
http://wiki.github.com/erlang/otp/submitting-patches

> 2) I think about my patch as a workaround for problem which points to the
> exact places in code which do the harm

By submitting in your patch in git, it will be much easier for everyone
else to testing your patch and the patch will be listed in "What's cooking in
erlang/otp", so it will not be forgotten.

If you also could provide some instructions how to reproduce the problem,
it would help to find the real problem (please put all information in the commit
message)

> And answer to your question: no I don't think so. But if I will see any
> words about `redo it in git`, I'll do so w/o any probs.

Please redo it in git. :)

Actually, I would suggest copying nthtail/2 from lists and modify it
like this (NOT TESTED):

safe_nthtail(_, []) -> [];
safe_nthtail(1, [_|T]) -> T;
safe_nthtail(N, [_|T]) when N > 1 ->
    safe_nthtail(N - 1, T);
safe_nthtail(0, L) when is_list(L) -> L.

rather than traversing the list twice.

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list