[Bug 75581] [next] remove tp_message_peek()

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 3 11:01:31 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=75581

--- Comment #19 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
(In reply to comment #11)
> > +  token = tp_message_dup_token (message);
> > +  supersedes = tp_message_dup_supersedes (message);
> 
> Inline get_message_edit_timestamp here, maybe? (Non-blocker)

Sorry, I was unclear.

What I meant was that get_message_edit_timestamp() calls
tp_message_dup_supersedes():

 get_message_edit_timestamp (TpMessage *message)
{
- if (tp_message_get_supersedes (message) != NULL)
- return get_network_timestamp (message);
+ gchar *supersedes;
+
+ supersedes = tp_message_dup_supersedes (message);
+ if (supersedes != NULL)
+ {
+ g_free (supersedes);
+ return get_network_timestamp (message);
+ }
else
- return 0;
+ {
+ return 0;
+ }
}

(sorry for the indentation damage, cgit is being invaluable)

and so you could save a malloc/free if you inlined get_message_edit_timestamp
into its caller, which already needs to call tp_message_get_supersedes()
anyway.

OTOH, if there are other callers, that's more annoying.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the telepathy-bugs mailing list