mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
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:
parent
d65db7c5ed
commit
ceffeab1de
6 changed files with 23 additions and 23 deletions
|
@ -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('');
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue