Commit bcc99f97 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

parseInt -> '>>'

http://jsperf.com/testparseint
refactoring code

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56754 954022d7-b5bf-4e40-9824-e11837661b57
parent 8bfd4a49
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
this.b2 = this.c2.getB(); this.b2 = this.c2.getB();
}; };
CGradient.prototype.calculateColor = function (indexColor) { CGradient.prototype.calculateColor = function (indexColor) {
indexColor = parseInt((indexColor - this.min) * this.koef); indexColor = ((indexColor - this.min) * this.koef) >> 0;
var r = (this.r1 + ((FT_Common.IntToUInt(this.r2 - this.r1) * indexColor) >> this.base_shift)) & 0xFF; var r = (this.r1 + ((FT_Common.IntToUInt(this.r2 - this.r1) * indexColor) >> this.base_shift)) & 0xFF;
var g = (this.g1 + ((FT_Common.IntToUInt(this.g2 - this.g1) * indexColor) >> this.base_shift)) & 0xFF; var g = (this.g1 + ((FT_Common.IntToUInt(this.g2 - this.g1) * indexColor) >> this.base_shift)) & 0xFF;
......
...@@ -6477,7 +6477,7 @@ ...@@ -6477,7 +6477,7 @@
dst_len += String.fromCharCode(_c); dst_len += String.fromCharCode(_c);
} }
var dstLen = parseInt(dst_len); var dstLen = dst_len >> 0;
var pointer = g_memory.Alloc(dstLen); var pointer = g_memory.Alloc(dstLen);
var stream = new FT_Stream2(pointer.data, dstLen); var stream = new FT_Stream2(pointer.data, dstLen);
stream.obj = pointer.obj; stream.obj = pointer.obj;
......
...@@ -291,7 +291,7 @@ function CorrectAscColor(asc_color) ...@@ -291,7 +291,7 @@ function CorrectAscColor(asc_color)
case c_oAscColor.COLOR_TYPE_SCHEME: case c_oAscColor.COLOR_TYPE_SCHEME:
{ {
// тут выставляется ТОЛЬКО из меню. поэтому: // тут выставляется ТОЛЬКО из меню. поэтому:
var _index = parseInt(asc_color.get_value()); var _index = asc_color.get_value() >> 0;
var _id = (_index / 6) >> 0; var _id = (_index / 6) >> 0;
var _pos = _index - _id * 6; var _pos = _index - _id * 6;
var basecolor = g_oColorManager.getThemeColor(_id); var basecolor = g_oColorManager.getThemeColor(_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment