diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-11-16 01:10:05 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-11-16 01:10:05 +0000 |
commit | ea73d4a55cf10850c61ed35d58fd9c9a191023f3 (patch) | |
tree | 87fd46511932572dfcec12f2e1630ea289e9a512 /epan/dissectors/file-elf.c | |
parent | 09dc9a3d0a029fc669e09b3d2ff468b07b9b0c7b (diff) |
Avoid calling find_dissector(), cache result of [new_]register_dissector()
svn path=/trunk/; revision=53353
Diffstat (limited to 'epan/dissectors/file-elf.c')
-rw-r--r-- | epan/dissectors/file-elf.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/epan/dissectors/file-elf.c b/epan/dissectors/file-elf.c index d91c803199..3b0eba059e 100644 --- a/epan/dissectors/file-elf.c +++ b/epan/dissectors/file-elf.c @@ -40,6 +40,8 @@ #include "dwarf.h" +static dissector_handle_t elf_handle; + static int proto_elf = -1; static int hf_elf_magic_bytes = -1; @@ -2409,7 +2411,8 @@ proto_register_elf(void) proto_elf = proto_register_protocol("Executable and Linkable Format", "ELF", "elf"); proto_register_field_array(proto_elf, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - new_register_dissector("elf", dissect_elf, proto_elf); + + elf_handle = new_register_dissector("elf", dissect_elf, proto_elf); module = prefs_register_protocol(proto_elf, NULL); prefs_register_static_text_preference(module, "version", @@ -2423,10 +2426,6 @@ proto_register_elf(void) void proto_reg_handoff_elf(void) { - dissector_handle_t elf_handle; - - elf_handle = find_dissector("elf"); - dissector_add_string("media_type", "application/x-executable", elf_handle); dissector_add_string("media_type", "application/x-coredump", elf_handle); dissector_add_string("media_type", "application/x-object", elf_handle); |