Skip to content

Conversation

@ds5678
Copy link
Contributor

@ds5678 ds5678 commented Oct 28, 2025

No description provided.

Comment on lines 6591 to 6596
var pointerSuffix = "";
if (pointerIndirectionLevel > 0)
{
pointerSuffix = string.Concat(Enumerable.Repeat("Pointer", pointerIndirectionLevel));
}
name = $"To{returnTypeName}{pointerSuffix}";
Copy link
Member

Choose a reason for hiding this comment

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

This is going to be quite expensive for the most common case of "no suffix" and the second less common case of "1 indirection".

I would expect that repeated levels of indirections become increasingly less common, and that it is worth special casing at least 0, 1, 2 levels and to leave everything else to the "expensive" path using Enumerable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you prefer ToInt32PointerPointer or ToInt32Pointer2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you prefer ToInt32PointerPointer or ToInt32Pointer2?

I assumed the latter since it's more efficient and scales better, but I'd be happy to switch if you prefer the former.

@ds5678 ds5678 requested a review from tannergooding October 28, 2025 20:38
@ds5678 ds5678 force-pushed the conversions-to-pointer branch from 73bca45 to 2c3733e Compare November 2, 2025 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants