Skip to content

Commit

Permalink
Switched to simple optimizations as this shouldn't matter anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Oct 26, 2015
1 parent 6156cb4 commit 121e55b
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 29 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "long",
"version": "3.0.0",
"version": "3.0.1",
"author": "Daniel Wirtz <[email protected]>",
"description": "A Long class for representing a 64 bit two's-complement integer value.",
"main": "dist/long.js",
Expand Down
8 changes: 4 additions & 4 deletions dist/long.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
* @expose
*/
LongPrototype.lessThan = function lessThan(other) {
return this.compare(/* validates */ other) < 0;
return this.comp(/* validates */ other) < 0;
};

/**
Expand All @@ -593,7 +593,7 @@
* @expose
*/
LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
return this.compare(/* validates */ other) <= 0;
return this.comp(/* validates */ other) <= 0;
};

/**
Expand All @@ -612,7 +612,7 @@
* @expose
*/
LongPrototype.greaterThan = function greaterThan(other) {
return this.compare(/* validates */ other) > 0;
return this.comp(/* validates */ other) > 0;
};

/**
Expand All @@ -631,7 +631,7 @@
* @expose
*/
LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
return this.compare(/* validates */ other) >= 0;
return this.comp(/* validates */ other) >= 0;
};

/**
Expand Down
32 changes: 16 additions & 16 deletions dist/long.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/long.min.js.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions dist/long.min.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions externs/long.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ Long.prototype.gte = function(other) {};
*/
Long.prototype.compare = function(other) {};

/**
* @param {!Long|number|string} other
* @return {number}
*/
Long.prototype.comp = function(other) {};

/**
* @return {!Long}
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"build": "node scripts/build.js",
"make": "npm run-script build && npm run-script compile && npm run-script compress && npm test",
"compile": "ccjs dist/long.js --compilation_level=ADVANCED_OPTIMIZATIONS --create_source_map=dist/long.min.map > dist/long.min.js",
"compile": "ccjs dist/long.js --compilation_level=SIMPLE_OPTIMIZATIONS --create_source_map=dist/long.min.map > dist/long.min.js",
"compress": "gzip -c -9 dist/long.min.js > dist/long.min.js.gz",
"test": "node node_modules/testjs/bin/testjs tests/suite.js"
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var rootDir = path.join(__dirname, ".."),
var scope = {};

// Build
console.log("Building Long with scope", JSON.stringify(scope, null, 2));
console.log("Building long.js with scope", JSON.stringify(scope, null, 2));
fs.writeFileSync(
path.join(distDir, "long.js"),
MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir)
Expand Down
8 changes: 4 additions & 4 deletions src/long.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ LongPrototype.neq = LongPrototype.notEquals;
* @expose
*/
LongPrototype.lessThan = function lessThan(other) {
return this.compare(/* validates */ other) < 0;
return this.comp(/* validates */ other) < 0;
};

/**
Expand All @@ -559,7 +559,7 @@ LongPrototype.lt = LongPrototype.lessThan;
* @expose
*/
LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
return this.compare(/* validates */ other) <= 0;
return this.comp(/* validates */ other) <= 0;
};

/**
Expand All @@ -578,7 +578,7 @@ LongPrototype.lte = LongPrototype.lessThanOrEqual;
* @expose
*/
LongPrototype.greaterThan = function greaterThan(other) {
return this.compare(/* validates */ other) > 0;
return this.comp(/* validates */ other) > 0;
};

/**
Expand All @@ -597,7 +597,7 @@ LongPrototype.gt = LongPrototype.greaterThan;
* @expose
*/
LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
return this.compare(/* validates */ other) >= 0;
return this.comp(/* validates */ other) >= 0;
};

/**
Expand Down

0 comments on commit 121e55b

Please sign in to comment.