Closed EFLql closed 7 years ago
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!
If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!
@snarkmaster has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@EFLql, we won't merge this commit as-is because it does not follow the ambient coding style. Please add whitespace around {
and }
as in the rest of the code.
Additionally, I would put /* no increment */
into the third, now-empty expression of the for
loop.
Good catch. Yeah, this function is kind of a mess. I think this change probably makes it more correct, but I think it's still not very clear and I'm not very confident that there's no bugs.
Can you rewrite it using std::remove_if
or similar?
http://en.cppreference.com/w/cpp/algorithm/remove
http://en.cppreference.com/w/cpp/algorithm
@fugalh Yeah, it is clear by using std::remove_if.
@snarkmaster has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@EFLql, the unit test no longer passes with your change --
Start 11: PipelineTest
11/19 Test #11: PipelineTest .........................***Exception: Other 0.01 sec
Start 12: CodecTest
There is a bug when removeHelper's arguments is handler == nullptr and checkEqual== false.Because std::vecotr<>::erase will return a iterator following the last removed element, In this case the loop should't add it when the function named removeAt has executed.