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

RFC: Deprecate table.getn/foreach/foreachi #715

Merged
merged 1 commit into from Feb 14, 2023
Merged

Conversation

zeux
Copy link
Collaborator

@zeux zeux commented Oct 18, 2022

@zeux zeux added the rfc Language change proposal label Oct 18, 2022
@zeux
Copy link
Collaborator Author

zeux commented Oct 18, 2022

To provide additional anecdotal data from Roblox internal shipping codebase (~2 MLOC):

  • table.getn is used 13 times; in all cases, it can be replaced with # with no loss of functionality/expressiveness/strictness
  • table.foreach is used 18 times; out of these, 16 uses use an anonymous function and as such could trivially be expressed with a shorter and faster for loop; two uses use a combination of an anonymous function and a local function wrapper over it, which can also be converted to a for loop without any issues.
  • table.foreachi is never used

@zeux zeux merged commit 8f37fc6 into master Feb 14, 2023
@zeux zeux deleted the zeux-rfc-deptable branch February 14, 2023 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfc Language change proposal
Development

Successfully merging this pull request may close these issues.

None yet

2 participants