diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-08-10 04:13:37 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-08-10 04:13:37 +0000 |
commit | 86a8ad1dcd6af20f8982e39cc70f3debaa2a8352 (patch) | |
tree | c8fb7d5a71eab0ef89a425465a8e37b9fb9ccb90 /file.h | |
parent | 5ad4d240bbcc9382d85dbdf67ece60295816ebca (diff) | |
download | wireshark-86a8ad1dcd6af20f8982e39cc70f3debaa2a8352.tar.gz wireshark-86a8ad1dcd6af20f8982e39cc70f3debaa2a8352.tar.bz2 wireshark-86a8ad1dcd6af20f8982e39cc70f3debaa2a8352.zip |
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).
svn path=/trunk/; revision=457
Diffstat (limited to 'file.h')
-rw-r--r-- | file.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,7 +1,7 @@ /* file.h * Definitions for file structures and routines * - * $Id: file.h,v 1.26 1999/08/07 17:28:21 deniel Exp $ + * $Id: file.h,v 1.27 1999/08/10 04:13:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -76,7 +76,8 @@ typedef struct _capture_file { */ /*guint8 pd[MAX_PACKET_SIZE];*/ /* Packet data */ guint8 pd[65536]; /* Packet data */ - GList *plist; /* Packet list */ + frame_data *plist; /* Packet list */ + frame_data *plist_end; /* Last packet in list */ column_info cinfo; /* Column formatting information */ int selected_packet; /* Index in packet list of currently selected packet, if any */ int selected_row; /* Row in packet display of currently selected packet, if any */ |