summaryrefslogtreecommitdiff
path: root/print.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2009-07-12 10:19:13 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2009-07-12 10:19:13 +0000
commit27572c22f4c47b845c90700f46e27d239515531c (patch)
tree8a20bb03d20a569e22078dd31657e0eaa9bd66e3 /print.c
parent052a2b965a424465fb87c83a5f2009b35471be8b (diff)
downloadwireshark-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/print.c b/print.c
index 580ba1ff88..d9178a842d 100644
--- a/print.c
+++ b/print.c
@@ -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);