Building a GList by adding elements to the end with "g_list_append()" is
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Aug 1999 04:13:37 +0000 (04:13 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Aug 1999 04:13:37 +0000 (04:13 +0000)
commitf4e1e6a41410ae372f2565eda305e7b3d1aa91ee
treec8fb7d5a71eab0ef89a425465a8e37b9fb9ccb90
parentaa90289afc2f8e8717947a0c42f1a281c1bf1719
Building a GList by adding elements to the end with "g_list_append()" is
N^2 in the ultimate size of the list (as "g_list_append()" is linear in
the size of the list, at least when used in the way the GLib
documentation says to use it); instead, maintain our own linked list of
"frame_data" structures for all packets read, including a pointer to the
last element.

"gtk_clist_set_row_data()" is linear in the row number, so if it's used
to attach a pointer to the "frame_data" structure for a packet to the
packet list GtkClist row for each packet, that's also N^2 in the number
of packets in that packet list; instead, store the row number in the
"frame_data" structure, and find the packet for a given row by scanning
the list for it (we were already scanning the list linearly to find that
packet's index in the list of all packets; that's only done when a
packet's selected, so it's not *too* bad, but it might be nice to avoid
having to do that scan).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@457 f5534014-38df-0310-8fa8-9805f1628bb7
ethereal.c
file.c
file.h
packet.h
summary.c