mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Remove variable shadowing
Refactor to remove all no-shadow warnings.
This commit is contained in:
1 parent
e5e82ba2fb
commit
00a1f6aea7
14 files changed
+87
-86
No files matched your search
@@ -130,19 +130,19 @@ async function exportItems(server, modVersions, items) {
|
||||
let pos = 0;
|
||||
|
||||
let iconCache = new Map();
|
||||
async function loadIcon(path, iconSize, iconMipmaps) {
|
||||
let icon = iconCache.get(path);
|
||||
async function loadIcon(iconPath, iconSize, iconMipmaps) {
|
||||
let icon = iconCache.get(iconPath);
|
||||
if (icon === undefined) {
|
||||
let fileContent = await loadFile(server, modVersions, path);
|
||||
let fileContent = await loadFile(server, modVersions, iconPath);
|
||||
if (fileContent) {
|
||||
icon = await Jimp.read(fileContent);
|
||||
icon.crop(0, 0, iconSize, iconSize);
|
||||
iconCache.set(path, icon);
|
||||
iconCache.set(iconPath, icon);
|
||||
} else {
|
||||
icon = null;
|
||||
console.log(`Warning: ${path} not found`);
|
||||
console.log(`Warning: ${iconPath} not found`);
|
||||
}
|
||||
iconCache.set(path, icon);
|
||||
iconCache.set(iconPath, icon);
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
@@ -169,8 +169,8 @@ function reorderDependencies(modules) {
|
||||
// the module depends on a module that satisfy any of these conditions.
|
||||
|
||||
let remaining = new Map();
|
||||
for (let modules of hold.values()) {
|
||||
for (let module of modules) {
|
||||
for (let heldModules of hold.values()) {
|
||||
for (let module of heldModules) {
|
||||
remaining.set(module.name, module);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user