Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Dmitriy Paliy <dmitriy.paliy@nokia.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Change append to prepend in media_transport_add
Date: Sun, 29 May 2011 22:31:42 +0300	[thread overview]
Message-ID: <20110529193142.GA4687@dell.Elisa> (raw)
In-Reply-To: <1306499060-10415-1-git-send-email-dmitriy.paliy@nokia.com>

Hi Dmitriy,

On Fri, May 27, 2011, Dmitriy Paliy wrote:
> ---
>  audio/transport.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/audio/transport.c b/audio/transport.c
> index 702bef2..85358c7 100644
> --- a/audio/transport.c
> +++ b/audio/transport.c
> @@ -487,7 +487,7 @@ static void media_transport_add(struct media_transport *transport,
>  					struct media_owner *owner)
>  {
>  	DBG("Transport %s Owner %s", transport->path, owner->name);
> -	transport->owners = g_slist_append(transport->owners, owner);
> +	transport->owners = g_slist_prepend(transport->owners, owner);
>  	owner->transport = transport;
>  }

Since this is an optimization you should include proper justification
for it in the commit message body (it's ok for the summary to answer the
question "what?" but the body should answer the "why?"). I.e. something
along the lines of "This is a performance critical part of the code and
the ordering of elements doesn't matter, so use prepend instead of
append". Btw, if this *isn't* a performance critical part of the code
I'm not sure it's worth going about doing patches like this.

Johan

      reply	other threads:[~2011-05-29 19:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 12:24 [PATCH] Change append to prepend in media_transport_add Dmitriy Paliy
2011-05-29 19:31 ` Johan Hedberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110529193142.GA4687@dell.Elisa \
    --to=johan.hedberg@gmail.com \
    --cc=dmitriy.paliy@nokia.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox