Page MenuHome

Cleanup: Non-pointer TreeUpdateResult
AbandonedPublic

Authored by Iliya Katueshenock (Moder) on Dec 1 2022, 7:38 PM.

Details

Summary

Size of TreeUpdateResult is only 2 bytes. It can always be passed by value.
In this case it is used as reference and const. This is a bit redurant.

Diff Detail

Event Timeline

Iliya Katueshenock (Moder) requested review of this revision.Dec 1 2022, 7:38 PM
Iliya Katueshenock (Moder) created this revision.
Iliya Katueshenock (Moder) retitled this revision from Cleanup: node tree update to Cleanup: Non-pointer TreeUpdateResult.
Iliya Katueshenock (Moder) edited the summary of this revision. (Show Details)

TreeUpdateResult is currently very small, up that doesn't mean it always will be. Currently I see no value in passing it by value. Passing by const reference should be the default for structs and I don't see a reason to make an exception here.

Also, it is stored by value throughout the update code. I'm not sure if this could be a confusion, since as far as I understand, the map that owns the original doesn't seem to change anymore.

Hm, fair enough, don't mind much either way.