mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Update len-metamethod-rawlen.md
This commit is contained in:
parent
52b783d6d5
commit
c45bb8b4cf
1 changed files with 2 additions and 0 deletions
|
@ -35,6 +35,8 @@ and even when it is, using the existing metamethod-absence-caching approach we u
|
|||
statistically significant difference on existing benchmark suite. This does complicate the `#` computation a little more which may affect JIT as well, but even if the
|
||||
table doesn't have a metatable the process of computing `#` involves a series of condition checks and as such will likely require slow paths anyway.
|
||||
|
||||
This is technically changing semantics of `#` when called on tables with an existing `__len` metamethod, and as such has a potential to change behavior of an existing valid program. That said, it's unlikely that any table would have a metatable with `__len` metamethod as outside of userdata these do not do anything.
|
||||
|
||||
## Alternatives
|
||||
|
||||
Do not implement `__len`.
|
||||
|
|
Loading…
Add table
Reference in a new issue