* [PATCH] Change append to prepend in media_transport_add
@ 2011-05-27 12:24 Dmitriy Paliy
2011-05-29 19:31 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Dmitriy Paliy @ 2011-05-27 12:24 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Dmitriy Paliy
---
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;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Change append to prepend in media_transport_add
2011-05-27 12:24 [PATCH] Change append to prepend in media_transport_add Dmitriy Paliy
@ 2011-05-29 19:31 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-05-29 19:31 UTC (permalink / raw)
To: Dmitriy Paliy; +Cc: linux-bluetooth
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-29 19:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 12:24 [PATCH] Change append to prepend in media_transport_add Dmitriy Paliy
2011-05-29 19:31 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox