Uh oh!
There was an error while loading. Please reload this page.
[Fix] Fix flaky test of #9952 - #9958
Conversation
66852ba to
a67f850CompareMasterJH5574
commented
Jan 18, 2022
Thanks @wrongtest for the fix! If you can make sure the indeterminism doesn't happen again, please also kindly revert this hot fix PR (#9956) by removing the "skip" mark and the pytest import. |
MasterJH5574
left a comment
There was a problem hiding this comment.
LGTM. Please take a look at my comment, thanks!
| for (const Var& var : cand_vars) { | ||
| if (!var_set.count(var)) { | ||
| vars.push_back(var); | ||
| var_set.insert(var); | ||
| } | ||
| } |
There was a problem hiding this comment.
Personally I recommend using std::find(vars.begin(), vars.end(), var) != vars.end() instead of using a var_set for looking up, because usually we don't have few variables and the map doesn't bring performance improvement :-)
There was a problem hiding this comment.
std::find(vars.begin(), vars.end(), var) != vars.end()
Thanks for the advice~ I would change to O(n) search and commit to retrigger CI again.
* fix to stablize the var orders when solve bounds in region analysis * change to std::find_if since num of vars is generally small
* fix to stablize the var orders when solve bounds in region analysis * change to std::find_if since num of vars is generally small
* fix to stablize the var orders when solve bounds in region analysis * change to std::find_if since num of vars is generally small
fix#9952