@quenty/tuple 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +4 -4
- package/src/Shared/TupleLookup.lua +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/tuple@1.2.0...@quenty/tuple@1.3.0) (2024-10-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Performance Improvements
|
|
10
|
+
|
|
11
|
+
* Increase cache size for tuple lookup ([5817760](https://github.com/Quenty/NevermoreEngine/commit/5817760b869500376f5654dfd312c2fdca2cef36))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/tuple@1.1.0...@quenty/tuple@1.2.0) (2024-09-25)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/tuple
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/tuple",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Tuple utility package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/loader": "^10.
|
|
29
|
-
"@quenty/lrucache": "^1.
|
|
28
|
+
"@quenty/loader": "^10.6.0",
|
|
29
|
+
"@quenty/lrucache": "^1.4.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "035abfa088c854a73e1c65b350267eaa17669646"
|
|
35
35
|
}
|
|
@@ -16,6 +16,7 @@ function TupleLookup.new()
|
|
|
16
16
|
local self = setmetatable({}, TupleLookup)
|
|
17
17
|
|
|
18
18
|
self._tuples = setmetatable({}, { __mode = "k"})
|
|
19
|
+
self._singleArgTuples = setmetatable({}, { __mode = "kv"})
|
|
19
20
|
|
|
20
21
|
return self
|
|
21
22
|
end
|
|
@@ -27,6 +28,14 @@ end
|
|
|
27
28
|
@return Tuple<T>
|
|
28
29
|
]=]
|
|
29
30
|
function TupleLookup:ToTuple(...)
|
|
31
|
+
local n = select("#", ...)
|
|
32
|
+
if n == 1 then
|
|
33
|
+
local arg = ...
|
|
34
|
+
if self._singleArgTuples[arg] then
|
|
35
|
+
return self._singleArgTuples[arg]
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
30
39
|
local created = Tuple.new(...)
|
|
31
40
|
|
|
32
41
|
for item, _ in pairs(self._tuples) do
|
|
@@ -35,6 +44,9 @@ function TupleLookup:ToTuple(...)
|
|
|
35
44
|
end
|
|
36
45
|
end
|
|
37
46
|
|
|
47
|
+
if n == 1 then
|
|
48
|
+
self._singleArgTuples[...] = created
|
|
49
|
+
end
|
|
38
50
|
self._tuples[created] = true
|
|
39
51
|
|
|
40
52
|
return created
|