Skip to content

Commit 6ee9bd0

Browse files
authored
Refactor fximgSetData calls for clarity
1 parent 24a0f02 commit 6ee9bd0

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

fximg.helper.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,18 +266,17 @@ signture mismatch:
266266
const fxpic = pins.createBuffer(md.start + ((1 + (width * height * length)) >>> 1) + 5) as Fximg;
267267
(fxpic as Buffer)[0] = md.hash;
268268
(fxpic as Buffer)[1] = md.header;
269-
fximgSetData(fxpic, 0x0, width);
270-
fximgSetData(fxpic, 0x1, height);
271-
fximgSetData(fxpic, 0x2, length);
272269
const offsetData = pins.createBuffer(4);
273270
offsetData[0] = fximgGetIndex(fxpic, 0x0).idx & 0xff;
274271
offsetData[1] = fximgGetIndex(fxpic, 0x1).idx & 0xff;
275272
offsetData[2] = fximgGetIndex(fxpic, 0x2).idx & 0xff;
276273
offsetData[3] = fximgGetIndex(fxpic, 0x3).idx & 0xff;
277274
const offsetHash = offsetData.hash(HASH_POWER) & 0xff;
278275
(fxpic as Buffer).write((fxpic as Buffer).length - 5, offsetData);
279-
let text = fximgStartIndex(fxpic);
280276
(fxpic as Buffer)[(fxpic as Buffer).length - 1] = offsetHash;
277+
fximgSetData(fxpic, 0x0, width);
278+
fximgSetData(fxpic, 0x1, height);
279+
fximgSetData(fxpic, 0x2, length);
281280
fximgSetMetadataFrozen(fxpic, true);
282281
if (ro) fximgSetReadonly(fxpic, true);
283282
return fxpic as Fximg;

0 commit comments

Comments
 (0)