Skip to content

Commit

Permalink
Unnecessary function
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Oct 10, 2023
1 parent 42ebd4d commit a95072f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,6 @@ export function align(i: number, align: number) {
return o ? align - o + i : i;
}

/**
* Get ArrayBuffer from Buffer.
*
* @param buffer Buffer instance.
* @returns ArrayBuffer copy.
*/
export function bufferToArrayBuffer(buffer: Readonly<Buffer>) {
const {byteOffset, byteLength} = buffer;
return buffer.buffer.slice(byteOffset, byteOffset + byteLength);
}

/**
* Get launcher data for an ID.
*
Expand Down
4 changes: 2 additions & 2 deletions src/util/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Data
} from '@shockpkg/resedit';

import {align, bufferToArrayBuffer, launcher} from '../util';
import {align, launcher} from '../util';

// IMAGE_DATA_DIRECTORY indexes.
const IDD_RESOURCE = 2;
Expand Down Expand Up @@ -162,7 +162,7 @@ function exeUpdateSizes(exe: NtExecutable) {
* @param iconData Icon data.
*/
function rsrcPatchIcon(rsrc: NtExecutableResource, iconData: Readonly<Buffer>) {
const ico = Data.IconFile.from(bufferToArrayBuffer(iconData));
const ico = Data.IconFile.from(iconData);
for (const iconGroup of Resource.IconGroupEntry.fromEntries(rsrc.entries)) {
Resource.IconGroupEntry.replaceIconsForResource(
rsrc.entries,
Expand Down

0 comments on commit a95072f

Please sign in to comment.