Well I am not that skillful in C++, I want(ed) to use trivial:
bool operator() (const uint32_t & p1, const uint32_t & p2) const {
return p1.distance == p2.distance ? p1.serial < p2.serial :
p1.distance < p2.distance;
}
(not tested of course)
--
Oh, I just read about comparison of tuples, so I understand your example now,
thanks..
--
https://code.launchpad.net/~widelands-dev/widelands/request_supply_opt/+merge/280193
Your team Widelands Developers is subscribed to branch
lp:~widelands-dev/widelands/request_supply_opt.
That should work - but I would suggest to make a tiny private struct to improve
readability.
struct SupplyQuality {
uint32 distance;
uint32 serial;
bool operator<(const SupplyQuality& other) const {
return std::forward_as_tuple(distance, serial) <
Review: Approve
LGTM.
I cannot really quantify the performance gain, but i did not find any
regression.
--
https://code.launchpad.net/~widelands-dev/widelands/request_supply_opt/+merge/280193
Your team Widelands Developers is subscribed to branch
lp:~widelands-dev/widelands/request_supply_opt.
Travis build 101 has changed state to: passed. Details:
https://travis-ci.org/widelands/widelands/builds/99640935.
--
https://code.launchpad.net/~widelands-dev/widelands/bug-1526903/+merge/281410
Your team Widelands Developers is subscribed to branch
lp:~widelands-dev/widelands/bug-1526903.
Travis build 162 has changed state to: errored. Details:
https://travis-ci.org/widelands/widelands/builds/99874912.
--
https://code.launchpad.net/~widelands-dev/widelands/request_supply_opt/+merge/280193
Your team Widelands Developers is subscribed to branch
Travis build 124 has changed state to: failed. Details:
https://travis-ci.org/widelands/widelands/builds/99784765.
--
https://code.launchpad.net/~hjd/widelands/tests-poc/+merge/250533
Your team Widelands Developers is requested to review the proposed merge of
lp:~hjd/widelands/tests-poc into
Travis build 123 has changed state to: failed. Details:
https://travis-ci.org/widelands/widelands/builds/99784763.
--
https://code.launchpad.net/~widelands-dev/widelands/split_overlay_manager/+merge/254496
Your team Widelands Developers is requested to review the proposed merge of
Travis build 167 has changed state to: passed. Details:
https://travis-ci.org/widelands/widelands/builds/99877641.
--
https://code.launchpad.net/~widelands-dev/widelands/render_queue/+merge/250524
Your team Widelands Developers is subscribed to branch
lp:~widelands-dev/widelands/render_queue.
Travis build 122 has changed state to: failed. Details:
https://travis-ci.org/widelands/widelands/builds/99778652.
--
https://code.launchpad.net/~widelands-dev/widelands/map_compatibility/+merge/276088
Your team Widelands Developers is requested to review the proposed merge of
Travis build 127 has changed state to: failed. Details:
https://travis-ci.org/widelands/widelands/builds/99803809.
--
https://code.launchpad.net/~widelands-dev/widelands/bug-1397500/+merge/243860
Your team Widelands Developers is subscribed to branch
lp:~widelands-dev/widelands/bug-1397500.
Review: Needs Fixing
I think this is broken in the current state. The problem is that logic depends
on available_supply which is a multimap. The problem is that the map is sorted
by distance, then by a pointer.
In a replay or in a multiplayer games, the order of elements in this map is
Travis build 162 has changed state to: passed. Details:
https://travis-ci.org/widelands/widelands/builds/99874912.
--
https://code.launchpad.net/~widelands-dev/widelands/request_supply_opt/+merge/280193
Your team Widelands Developers is subscribed to branch
13 matches
Mail list logo