mirror of
https://github.com/imezx/Warp.git
synced 2026-03-18 00:44:16 +00:00
rewrite(phase4): srry i have no choice :(
This commit is contained in:
parent
36b03dec02
commit
5f5bb7938c
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
--!optimize 2
|
||||
--!native
|
||||
--@EternityDev
|
||||
local BITS: number = 8
|
||||
local BITS: number = 16
|
||||
local MAX_VALUE: number = bit32.lshift(1, BITS) - 1
|
||||
|
||||
local cache: { [string]: number } = {}
|
||||
|
|
@ -13,7 +13,7 @@ return function(name: string): number
|
|||
if cached then
|
||||
return cached
|
||||
end
|
||||
if count >= MAX_VALUE then
|
||||
if count >= 255 then -- 255 is safer from collision
|
||||
warn("ran out of ids :(")
|
||||
return 0
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue