Skip to content

Commit

Permalink
style(marshal): Rename some variables to align with conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Jan 23, 2024
1 parent 2dd3b43 commit dac5bc0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/marshal/src/encodePassable.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ const decodeRecord = (encoded, decodePassable) => {
assert(encoded.startsWith('('));
// Skip the "(" inside `decodeArray` to avoid slow `substring` in XS.
// https://github.com/endojs/endo/issues/1984
const keysvals = decodeArray(encoded, decodePassable, 1);
keysvals.length === 2 || Fail`expected keys,values pair: ${encoded}`;
const [keys, vals] = keysvals;
const unzippedEntries = decodeArray(encoded, decodePassable, 1);
unzippedEntries.length === 2 || Fail`expected keys,values pair: ${encoded}`;
const [keys, vals] = unzippedEntries;

(passStyleOf(keys) === 'copyArray' &&
passStyleOf(vals) === 'copyArray' &&
Expand All @@ -317,9 +317,9 @@ const decodeTagged = (encoded, decodePassable) => {
assert(encoded.startsWith(':'));
// Skip the ":" inside `decodeArray` to avoid slow `substring` in XS.
// https://github.com/endojs/endo/issues/1984
const tagpayload = decodeArray(encoded, decodePassable, 1);
tagpayload.length === 2 || Fail`expected tag,payload pair: ${encoded}`;
const [tag, payload] = tagpayload;
const taggedPayload = decodeArray(encoded, decodePassable, 1);
taggedPayload.length === 2 || Fail`expected tag,payload pair: ${encoded}`;
const [tag, payload] = taggedPayload;
passStyleOf(tag) === 'string' ||
Fail`not a valid tagged encoding: ${encoded}`;
return makeTagged(tag, payload);
Expand Down

0 comments on commit dac5bc0

Please sign in to comment.