From 2041921fcbaedf2f32ff92f6f38422f149258f46 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2020 10:35:04 +0100 Subject: [PATCH] Obj: make the Location destructor non-virtual Nobody ever derives from this class. This removes an indirect call and allows inlining the destructor. This speeds up Zeek startup by 1-2%. --- src/Obj.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Obj.h b/src/Obj.h index 0c96013620..df5088179e 100644 --- a/src/Obj.h +++ b/src/Obj.h @@ -6,7 +6,7 @@ class ODesc; -class Location { +class Location final { public: Location(const char* fname, int line_f, int line_l, int col_f, int col_l) { @@ -30,7 +30,7 @@ public: text = 0; } - virtual ~Location() + ~Location() { if ( delete_data ) delete [] filename;