[Commits] [wesnoth/wesnoth] 59cedd: improve listbox::clear() performance. (#982)

GitHub noreply at github.com
Thu Apr 13 14:53:41 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 59ceddf917837fdf959ec4a9a4ea724e4ca32980
      https://github.com/wesnoth/wesnoth/commit/59ceddf917837fdf959ec4a9a4ea724e4ca32980
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-04-13 (Thu, 13 Apr 2017)

  Changed paths:
    M src/gui/widgets/generator_private.hpp
    M src/gui/widgets/listbox.cpp

  Log Message:
  -----------
  improve listbox::clear() performance. (#982)

previously listbox::clear() removed all elements one by one.
This was quite ineffective since due to the listbox always-one-element-selected behviour this required calculating which is the next element in this list in the current order. Which then again requires resorting of the whole list since due to the list content change (removal) the order cache is cleared.

this could also fix https://gna.org/bugs/?25504

this also fixed a bug in generator::clear()





More information about the Commits mailing list