mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Merge pull request #1041 from javascript-obfuscator/m1-performance
Apple M1 performance fix
This commit is contained in:
@@ -3,6 +3,7 @@ Change Log
|
||||
v3.0.1
|
||||
---
|
||||
* Dependencies update
|
||||
* Fixed performance for Apple M1 chip
|
||||
|
||||
v3.0.0
|
||||
---
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@
|
||||
"test:mocha": "mocha --require ts-node/register --require source-map-support/register test/index.spec.ts --exit",
|
||||
"test:mocha-coverage": "nyc --reporter text-summary --no-clean yarn run test:mocha",
|
||||
"test:mocha-coverage:report": "nyc report --reporter=lcov",
|
||||
"test:mocha-memory-performance": "cross-env NODE_OPTIONS=--max-old-space-size=220 mocha --require ts-node/register test/performance-tests/JavaScriptObfuscatorMemory.spec.ts",
|
||||
"test:mocha-memory-performance": "cross-env NODE_OPTIONS=--max-old-space-size=230 mocha --require ts-node/register test/performance-tests/JavaScriptObfuscatorMemory.spec.ts",
|
||||
"test": "yarn run test:full",
|
||||
"eslint": "eslint src/**/*.ts",
|
||||
"git:addFiles": "git add .",
|
||||
|
||||
@@ -104,14 +104,15 @@ export class NumberUtils {
|
||||
currentFactor <= root;
|
||||
currentFactor += incrementValue
|
||||
) {
|
||||
if (number % currentFactor !== 0) {
|
||||
const compliment: number = number / currentFactor;
|
||||
const check = (number - Math.floor(compliment) * currentFactor) !== 0;
|
||||
|
||||
if (check) {
|
||||
continue;
|
||||
}
|
||||
|
||||
factors.push(...[-currentFactor, currentFactor]);
|
||||
|
||||
const compliment: number = number / currentFactor;
|
||||
|
||||
if (compliment !== currentFactor) {
|
||||
factors.push(...[-compliment, compliment]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user