diff options
author | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-07-12 10:19:13 +0000 |
---|---|---|
committer | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-07-12 10:19:13 +0000 |
commit | a89df87cad96d23a76fd10b039a8d5af6aa845ad (patch) | |
tree | 8a20bb03d20a569e22078dd31657e0eaa9bd66e3 /print.c | |
parent | e0960adf23a15aa7f835f866cabd7707ddce3a40 (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.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); |