diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/core/manif.tl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/luarocks/core/manif.tl b/src/luarocks/core/manif.tl index a1c84995..a089b5d8 100644 --- a/src/luarocks/core/manif.tl +++ b/src/luarocks/core/manif.tl | |||
| @@ -41,7 +41,7 @@ local type Tree_manifest = manif.Tree_manifest | |||
| 41 | 41 | ||
| 42 | -- Table with repository identifiers as keys and tables mapping | 42 | -- Table with repository identifiers as keys and tables mapping |
| 43 | -- Lua versions to cached loaded manifests as values. | 43 | -- Lua versions to cached loaded manifests as values. |
| 44 | local manifest_cache: Manifest = {} | 44 | local manifest_cache: {string: {string: Manifest}} = {} |
| 45 | 45 | ||
| 46 | --- Cache a loaded manifest. | 46 | --- Cache a loaded manifest. |
| 47 | -- @param repo_url string: The repository identifier. | 47 | -- @param repo_url string: The repository identifier. |
| @@ -49,8 +49,8 @@ local manifest_cache: Manifest = {} | |||
| 49 | -- @param manifest table: the manifest to be cached. | 49 | -- @param manifest table: the manifest to be cached. |
| 50 | function manif.cache_manifest(repo_url: string, lua_version: string, manifest: Manifest) | 50 | function manif.cache_manifest(repo_url: string, lua_version: string, manifest: Manifest) |
| 51 | lua_version = lua_version or cfg.lua_version | 51 | lua_version = lua_version or cfg.lua_version |
| 52 | manifest_cache.repository[repo_url] = manifest_cache.repository[repo_url] or {} | 52 | manifest_cache[repo_url] = manifest_cache[repo_url] or {} |
| 53 | manifest_cache.repository[repo_url][lua_version] = manifest | 53 | manifest_cache[repo_url][lua_version] = manifest |
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | --- Attempt to get cached loaded manifest. | 56 | --- Attempt to get cached loaded manifest. |
| @@ -59,7 +59,7 @@ end | |||
| 59 | -- @return table or nil: loaded manifest or nil if cache is empty. | 59 | -- @return table or nil: loaded manifest or nil if cache is empty. |
| 60 | function manif.get_cached_manifest(repo_url: string, lua_version: string): Manifest | 60 | function manif.get_cached_manifest(repo_url: string, lua_version: string): Manifest |
| 61 | lua_version = lua_version or cfg.lua_version | 61 | lua_version = lua_version or cfg.lua_version |
| 62 | return manifest_cache.repository[repo_url] and manifest_cache.repository[repo_url][lua_version] | 62 | return manifest_cache[repo_url] and manifest_cache[repo_url][lua_version] |
| 63 | end | 63 | end |
| 64 | 64 | ||
| 65 | --- Back-end function that actually loads the manifest | 65 | --- Back-end function that actually loads the manifest |
