Skip to content

Commit bc4cffa

Browse files
diegomuraclaude
andcommitted
refactor(pdfkit): simplify fromBase64 loop
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 767840d commit bc4cffa

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/pdfkit/src/binary.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ export const toBinaryString = (bytes) => {
1414

1515
export const fromBase64 = (b64) => {
1616
const binary = atob(b64);
17-
const len = binary.length;
18-
const out = new Uint8Array(len);
19-
for (let i = 0; i < len; i++) {
17+
const out = new Uint8Array(binary.length);
18+
for (let i = 0; i < binary.length; i++) {
2019
out[i] = binary.charCodeAt(i);
2120
}
2221
return out;

0 commit comments

Comments
 (0)