mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 17:47:16 +00:00
Inline calculating position
This commit is contained in:
parent
974c903715
commit
2f6f1937a9
1 changed files with 2 additions and 10 deletions
|
|
@ -202,19 +202,11 @@ function decodeCode({ makiFile, classes, variables, methods }) {
|
|||
const length = makiFile.readUInt32LE();
|
||||
const start = makiFile.getPosition();
|
||||
|
||||
function getPos() {
|
||||
return makiFile.getPosition() - start;
|
||||
}
|
||||
const localFunctions = {};
|
||||
const commands = [];
|
||||
while (makiFile.getPosition() < start + length) {
|
||||
const command = parseComand({
|
||||
makiFile,
|
||||
length,
|
||||
pos: getPos(),
|
||||
localFunctions,
|
||||
});
|
||||
commands.push(command);
|
||||
const pos = makiFile.getPosition() - start;
|
||||
commands.push(parseComand({ makiFile, length, pos, localFunctions }));
|
||||
}
|
||||
|
||||
return { commands, localFunctions };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue