container: Implement StrTreeMap::ForEachConstContext#227
container: Implement StrTreeMap::ForEachConstContext#227MonsterDruide1 merged 2 commits intoopen-ead:masterfrom
StrTreeMap::ForEachConstContext#227Conversation
Fuzzy2319
left a comment
There was a problem hiding this comment.
I taked a look at TreeMapImpl::forEach. Since the function is recursive, I think it could be simplyfied like this. But that doesn't seems to help getting a match.
Reviewable status: 0 of 1 files reviewed, all discussions resolved
What if they just directly call the underlying TreeMapImpl::forEach function? It is public, after all. |
|
Makes no difference |
Your simplification is wrong BTW, since you don't process mRight anymore. Also, I just realized that the existing open-ead implementation uses a loop. Why not do it the way I'm doing it? I checked the scratch and that doesn't make an improvement (it remains the same), but at least this is much cleaner. |
MonsterDruide1
left a comment
There was a problem hiding this comment.
Handled that suggestion in #231 - please check there and comment your thoughts, @aboood40091.
@MonsterDruide1 reviewed 1 of 1 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @german77)


Based on the symbols generated by
ResourceSystem::removeCategoryin SMO it seems like the current implementation is not correct as it never generates theForEachConstContextnamespace nor theDelegate1functions. This implementation lines up as well with other sead repositories like @aboood40091 and @stupidestmodderWhile this implementation creates the right matching symbols I haven't been able to get a full match on the caller function as it appears that there's another variant of the ForEach function that allows you to provide a custom caller class https://decomp.me/scratch/R5MuA
It also seems like BOTW has been creating custom classes that pretty much reassemble this behavior but with pseudo random function names and namespaces and are very likely to break with this change. https://github.com/search?q=repo%3Azeldaret%2Fbotw+.ForEach&type=code
_ZN4sead10StrTreeMapILi156EPN2al8ResourceEE19ForEachConstContextIPFvRNS_14SafeStringBaseIcEES3_EE4callEPNS_11TreeMapNodeIS7_EE_ZN4sead11TreeMapImplINS_14SafeStringBaseIcEEE7forEachINS_9Delegate1INS_10StrTreeMapILi156EPN2al8ResourceEE19ForEachConstContextIPFvRS2_S9_EEEPNS_11TreeMapNodeIS2_EEEEEEvSI_RKT__ZN4sead9Delegate1INS_10StrTreeMapILi156EPN2al8ResourceEE19ForEachConstContextIPFvRNS_14SafeStringBaseIcEES4_EEEPNS_11TreeMapNodeIS8_EEE6invokeESF__ZNK4sead9Delegate1INS_10StrTreeMapILi156EPN2al8ResourceEE19ForEachConstContextIPFvRNS_14SafeStringBaseIcEES4_EEEPNS_11TreeMapNodeIS8_EEE5cloneEPNS_4HeapEThis change is