Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
petamoriken committed Oct 15, 2021
1 parent 6d69f67 commit 43ee4cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Float16Array.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function assertFloat16BitsArray(target) {
* @param {Float16Array} float16
* @returns {ArrayLike<number>}
*/
function getFloat16BitsArrayFromFloat16Array(float16) {
function getFloat16BitsArray(float16) {
let target = _(float16).target;

// from other realms
Expand Down Expand Up @@ -106,7 +106,7 @@ const applyHandler = Object.freeze({
apply(func, thisArg, args) {
// peel off Proxy
if (isFloat16Array(thisArg)) {
const target = getFloat16BitsArrayFromFloat16Array(thisArg);
const target = getFloat16BitsArray(thisArg);
return Reflect.apply(func, target, args);
}

Expand Down Expand Up @@ -153,7 +153,7 @@ export class Float16Array extends Uint16Array {
// input Float16Array
if (isFloat16Array(input)) {
// peel off Proxy
const float16bitsArray = getFloat16BitsArrayFromFloat16Array(input);
const float16bitsArray = getFloat16BitsArray(input);
super(float16bitsArray);

// object without ArrayBuffer
Expand Down Expand Up @@ -324,7 +324,7 @@ export class Float16Array extends Uint16Array {
// for optimization
if (Constructor === Float16Array) {
const proxy = new Float16Array(length);
const float16bitsArray = getFloat16BitsArrayFromFloat16Array(proxy);
const float16bitsArray = getFloat16BitsArray(proxy);

for (let i = 0; i < length; ++i) {
float16bitsArray[i] = roundToFloat16Bits(items[i]);
Expand Down Expand Up @@ -408,7 +408,7 @@ export class Float16Array extends Uint16Array {
// for optimization
if (Constructor === Float16Array) {
const proxy = new Float16Array(length);
const float16bitsArray = getFloat16BitsArrayFromFloat16Array(proxy);
const float16bitsArray = getFloat16BitsArray(proxy);

for (let i = 0; i < length; ++i) {
const val = convertToNumber(this[i]);
Expand Down Expand Up @@ -619,7 +619,7 @@ export class Float16Array extends Uint16Array {
// for optimization
if (isFloat16Array(input)) {
// peel off Proxy
const float16bitsArray = getFloat16BitsArrayFromFloat16Array(input);
const float16bitsArray = getFloat16BitsArray(input);
super.set(float16bitsArray, targetOffset);
return;
}
Expand Down

0 comments on commit 43ee4cc

Please sign in to comment.