Remove intermediate char[] allocation from ToHexStringUpper by stephentoub · Pull Request #29612 · dotnet/corefx (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense to flip the parameters of the private so the lambda isn't applying a twist? (I don't know if the JIT is smart enough to rewrite the parameter order of the private to fix that)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried, and it looks very strange to me to have the destination first, especially when they're named "chars" and "bytes" and so it's not clear which is the src and which is the dst. I can rename them, but... I think I'll just leave it if that's ok with you.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm fine either way. It just popped in as "maybe this would help the inliner", because I happened to be thinking about how weird inlining algorithms must be earlier today.