diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2009-07-12 10:19:13 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2009-07-12 10:19:13 +0000 |
commit | 27572c22f4c47b845c90700f46e27d239515531c (patch) | |
tree | 8a20bb03d20a569e22078dd31657e0eaa9bd66e3 /print.c | |
parent | 052a2b965a424465fb87c83a5f2009b35471be8b (diff) | |
download | wireshark-27572c22f4c47b845c90700f46e27d239515531c.tar.gz |
From Kovarththanan Rajaratnam via bug 3702:
This patch optimizes the data source name processing in add_new_data_source()
by delaying it. We now simply store the constant string and lazily compute the
name when needed. This gives a performance boost because we only need the name
if we have multiple data sources.
svn path=/trunk/; revision=29066
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -771,7 +771,7 @@ print_hex_data(print_stream_t *stream, epan_dissect_t *edt) GSList *src_le; data_source *src; tvbuff_t *tvb; - char *name; + const char *name; char *line; const guchar *cp; guint length; @@ -789,7 +789,7 @@ print_hex_data(print_stream_t *stream, epan_dissect_t *edt) src = src_le->data; tvb = src->tvb; if (multiple_sources) { - name = src->name; + name = get_data_source_name(src); print_line(stream, 0, ""); line = g_strdup_printf("%s:", name); print_line(stream, 0, line); |