style fixes

This commit is contained in:
BlackMATov
2025-10-07 22:56:29 +07:00
parent dc912eb6da
commit 6841bb42fe
2 changed files with 14 additions and 14 deletions

View File

@@ -154,11 +154,11 @@ function evolved.alive_any(...) end
Sometimes (for debugging purposes, for example), it is necessary to extract the index and version from an identifier or to pack them back into an identifier. The [`evolved.pack`](#evolvedpack) and [`evolved.unpack`](#evolvedunpack) functions can be used for this purpose.
```lua
---@param index integer
---@param version integer
---@param primary integer
---@param secondary integer
---@return evolved.id id
---@nodiscard
function evolved.pack(index, version) end
function evolved.pack(primary, secondary) end
---@param id evolved.id
---@return integer primary
@@ -1409,11 +1409,11 @@ function evolved.name(...) end
### `evolved.pack`
```lua
---@param index integer
---@param version integer
---@param primary integer
---@param secondary integer
---@return evolved.id id
---@nodiscard
function evolved.pack(index, version) end
function evolved.pack(primary, secondary) end
```
### `evolved.unpack`

View File

@@ -4789,20 +4789,20 @@ function __evolved_name(...)
end
end
---@param index integer
---@param version integer
---@param primary integer
---@param secondary integer
---@return evolved.id id
---@nodiscard
function __evolved_pack(index, version)
if index < 1 or index > 2 ^ 20 - 1 then
__error_fmt('the index (%d) is out of range [1, 2 ^ 20 - 1]', index)
function __evolved_pack(primary, secondary)
if primary < 1 or primary > 2 ^ 20 - 1 then
__error_fmt('the primary (%d) is out of range [1, 2 ^ 20 - 1]', primary)
end
if version < 1 or version > 2 ^ 20 - 1 then
__error_fmt('the version (%d) is out of range [1, 2 ^ 20 - 1]', version)
if secondary < 1 or secondary > 2 ^ 20 - 1 then
__error_fmt('the secondary (%d) is out of range [1, 2 ^ 20 - 1]', secondary)
end
return index + version * 2 ^ 20 --[[@as evolved.id]]
return primary + secondary * 2 ^ 20 --[[@as evolved.id]]
end
---@param id evolved.id