[Commits] [wesnoth/wesnoth-old] ed3446: Simplify map_labels::set_label() by factoring out ...

GitHub noreply at github.com
Sun Feb 23 22:34:03 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth-old
  Commit: ed3446a3e71fbe32956c7fa1d03513a19292ca17
      https://github.com/wesnoth/wesnoth-old/commit/ed3446a3e71fbe32956c7fa1d03513a19292ca17
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-23 (Sun, 23 Feb 2014)

  Changed paths:
    M src/map_label.cpp
    M src/map_label.hpp

  Log Message:
  -----------
  Simplify map_labels::set_label() by factoring out some find()s.

In two places, the code from get_label() was basically duplicated,
presumably because the public get_label() function returns a pointer
to a const object. I added a private version that returns a pointer
to a non-const object, and now set_label() is easier to read.


  Commit: 90501cf87254d3d87f876beb504f8734535d1dea
      https://github.com/wesnoth/wesnoth-old/commit/90501cf87254d3d87f876beb504f8734535d1dea
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-23 (Sun, 23 Feb 2014)

  Changed paths:
    M src/map_label.cpp

  Log Message:
  -----------
  Some cleanup of map_labels::set_label.

Two changes might warrant further explanation:
1) No need to set a property of an object (current_label->second)
   that you are about to erase.
2) Setting res to NULL when it is already NULL is a no-op. (This
   line exists because at one time res was set to something other
   than NULL.)


  Commit: bd09e01992e333a10a87d5bb5d520efca03f607b
      https://github.com/wesnoth/wesnoth-old/commit/bd09e01992e333a10a87d5bb5d520efca03f607b
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-23 (Sun, 23 Feb 2014)

  Changed paths:
    M changelog
    M players_changelog
    M src/map_label.cpp
    M src/map_label.hpp

  Log Message:
  -----------
  Clean up the logic that decides when labels are created and shown.

Fixes bug #21434.


Compare: https://github.com/wesnoth/wesnoth-old/compare/df002cdfa1cd...bd09e01992e3


More information about the Commits mailing list