Follow-up Comment #10, patch #1141 (project wesnoth): (Note that you patch contains a lot of trailing tabulations. You already did a mess with your pathfinding commit; so please fix your editor settings, change your editor, or use a script to remove them automatically.)
The algorithm looks a lot cleaner now. Small nitpick, please move the declaration of prev in the block it is used at the end of the algorithm. Also, you don't seem to erase the "upper" segment, it doesn't seem to be needed, does it? If you want the code to be readable and efficient, I suggest you rename segment to corner, add an explicit field y and rename count to top, add a comparison function on y, and replace the map<segment> by a set<corner>. That way, the code will look like: tie(lower, is_new) = corners.insert(corner(iter->y)) if (is_new && lower != corners.begin()) ... if (!lower->top) lower->x = iter->x; ... _______________________________________________________ Reply to this item at: <http://gna.org/patch/?1141> _______________________________________________ Message posté via/par Gna! http://gna.org/ _______________________________________________ Wesnoth-bugs mailing list Wesnoth-bugs@gna.org https://mail.gna.org/listinfo/wesnoth-bugs