aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2009-07-12 10:19:13 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2009-07-12 10:19:13 +0000
commita89df87cad96d23a76fd10b039a8d5af6aa845ad (patch)
tree8a20bb03d20a569e22078dd31657e0eaa9bd66e3 /print.c
parente0960adf23a15aa7f835f866cabd7707ddce3a40 (diff)
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29066 f5534014-38df-0310-8fa8-9805f1628bb7
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);