Compare commits
2 Commits
0b2fc6f495
...
ca94e59b53
| Author | SHA1 | Date | |
|---|---|---|---|
| ca94e59b53 | |||
| 1adfca2a9f |
@@ -16,6 +16,23 @@ Some limitations apply:
|
||||
- The passed function cannot tailcall or otherwise recursively call itself.
|
||||
- You must use this macro in it's specific form, i.e. `local <var> = MV_INLINE(function() ... end)`
|
||||
|
||||
Note that this pass acts more like a preprocessor that replaces the function calls with the results of the function (if any), and can have strange effects in some cases.
|
||||
|
||||
For example, when an inlined function is called, its function body is inserted right before the statement the call is in. This can lead to some unexpected behavior when used in `or` or `if` expressions:
|
||||
|
||||
```lua
|
||||
local called = false
|
||||
local testFunc = MV_INLINE(function()
|
||||
called = true
|
||||
return 'hi'
|
||||
end)
|
||||
|
||||
local foo = 'bar' or testFunc()
|
||||
print(foo, called)
|
||||
```
|
||||
|
||||
Will print `bar true`, where under normal circumstances testFunc should not be executed. This is because the `or` expression is evaluated after the inserted body.
|
||||
|
||||
## Valid Usage
|
||||
|
||||
```lua
|
||||
|
||||
@@ -9,7 +9,7 @@ lastmod: "2025-05-01T18:47:58-05:00"
|
||||
|
||||
MoonVeil provides multiple solutions to improve and optimize the performance of your scripts.
|
||||
|
||||
## Using the 'Fast VM' option
|
||||
## Using the 'Fast VM' preset
|
||||
|
||||
This preset is available in [your dashboard's settings](/docs/dashboard/). If you're still having performance issues, continue reading.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user