From 19675a1a4899f68a4e7afbd45cebc63b544650e4 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 20 Nov 2016 05:27:10 +0100 Subject: optimized RBTree: avoid unnecessary virtual RBTree and RBEntry implementation classes * whenever the implementation class was not exactly RBEntryType, it had to have a virtual destructor since RBTree cared about cleanup and had to delete its members. * Since it does not allocate them, it is consistent to remove RBTree::clear(). The destructor now only checks that subclasses have cleaned up. Implementing cleanup in the subclasses is trivial. * Consequently, RBEntryString no longer has to be virtual. HelpIndex and GotoTables are completely non-virtual now which saves memory (and a bit of cleanup speed). For QRegister, not much changes, though. --- src/help.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/help.cpp') diff --git a/src/help.cpp b/src/help.cpp index 542a11f..3b82c4c 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -51,7 +51,7 @@ HelpIndex::load(void) GDir *women_dir; const gchar *basename; - if (G_UNLIKELY(min() != NULL)) + if (G_LIKELY(min() != NULL)) /* already loaded */ return; -- cgit v1.2.3