From 93ad5ec32de124dfa0c054acfd1f2a378cb9ca75 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 7 Oct 2024 12:40:35 +0200 Subject: Optimise PlayerRelationsManager::clear Previous implementation was O(n^2), doing lots of work (saving file and updating UI) for each removed player. --- src/gui/widgets/tablemodel.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/tablemodel.h b/src/gui/widgets/tablemodel.h index 2e36992a..d4274e39 100644 --- a/src/gui/widgets/tablemodel.h +++ b/src/gui/widgets/tablemodel.h @@ -77,20 +77,19 @@ public: */ virtual gcn::Widget *getElementAt(int row, int column) const = 0; - virtual void installListener(TableModelListener *listener); - - virtual void removeListener(TableModelListener *listener); + void installListener(TableModelListener *listener); + void removeListener(TableModelListener *listener); protected: /** * Tells all listeners that the table is about to see an update */ - virtual void signalBeforeUpdate(); + void signalBeforeUpdate(); /** * Tells all listeners that the table has seen an update */ - virtual void signalAfterUpdate(); + void signalAfterUpdate(); private: std::set listeners; -- cgit v1.2.3-70-g09d2