Use 3 param method for converting r,g,b into css string.

This avoids creation of temporary arrays to pass them into the util
method. Also using "arguments" is more expensive then passing in 3
parameters.
This commit is contained in:
Fabian Lange 2014-10-27 21:30:47 +01:00
parent d65db7c5ed
commit ceffeab1de
6 changed files with 23 additions and 23 deletions

View file

@ -574,10 +574,10 @@ var Util = PDFJS.Util = (function UtilClosure() {
// makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids
// creating many intermediate strings.
Util.makeCssRgb = function Util_makeCssRgb(rgb) {
rgbBuf[1] = rgb[0];
rgbBuf[3] = rgb[1];
rgbBuf[5] = rgb[2];
Util.makeCssRgb = function Util_makeCssRgb(r, g, b) {
rgbBuf[1] = r;
rgbBuf[3] = g;
rgbBuf[5] = b;
return rgbBuf.join('');
};