Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always return a number from table.getn and table.getsize #97

Open
Garanas opened this issue Nov 10, 2024 · 2 comments
Open

Always return a number from table.getn and table.getsize #97

Garanas opened this issue Nov 10, 2024 · 2 comments

Comments

@Garanas
Copy link
Member

Garanas commented Nov 10, 2024

The assembly-based functions made by @KionX two years ago were left unused because they were incompatible with the previously existing functions. The Lua implementations would always return a number, regardless of the input type. For non-table types, it would simply return 0.

This is crucial for backwards compatibility. We can't use the faster alternatives until they always return a number.

@KionX
Copy link
Collaborator

KionX commented Nov 10, 2024

I don't understand what the problem is.
This function cannot be compatible with getn for performance reasons.
It is imported as getsize2 and empty2. Use them directly for tables.

@Garanas
Copy link
Member Author

Garanas commented Nov 10, 2024

I was mistaken - I was referring to table.getsize and table.empty. We can't use the new functions across the code base if they do not have the same behavior. It needs to be backwards compatible.

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

No branches or pull requests

2 participants