container: Improve TreeMap::forEach#231
Conversation
|
Could it be that they original saved left and right in variables at the beginning of the function instead? Does that still match? |
|
@aboood40091 No, that does not match. I can move |
|
@aboood40091 Any other comments? |
|
All good, and I'll let you decide if you want to use a temporary for left too. |
|
Yes, that's still not a bad idea. Adjusted accordingly. |
german77
left a comment
There was a problem hiding this comment.
@german77 partially reviewed 1 file.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @MonsterDruide1).
As suggested by @aboood40091 (#227 (comment)), our implementation of
TreeMap::forEachcan be slightly simplified to avoid an explicit loop and use recursion instead. Only change from his suggestion:node->mRightmust be fetched beforefun(node)is called to match the existing behaviour and keep existing functions matched.This change is