Bug 1356284 - Avoid a not strictly needed but expensive concat in Sqlite.jsm::bindParam. r=florian
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 13 Apr 2017 18:49:45 +0200
changeset 353072 e8e2593692a51149373b2645e69a4d22b99fc466
parent 353071 31430ca292f20731880b4b0035c72b74c95e9b19
child 353073 0150a0000fc0cb0570ae495976d844849f2e9a7f
push id31656
push userihsiao@mozilla.com
push dateFri, 14 Apr 2017 09:10:41 +0000
treeherdermozilla-central@cda24082bff8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1356284
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1356284 - Avoid a not strictly needed but expensive concat in Sqlite.jsm::bindParam. r=florian MozReview-Commit-ID: Kx1x4h5odsP
toolkit/modules/Sqlite.jsm
--- a/toolkit/modules/Sqlite.jsm
+++ b/toolkit/modules/Sqlite.jsm
@@ -677,17 +677,19 @@ ConnectionData.prototype = Object.freeze
   _bindParameters(statement, params) {
     if (!params) {
       return;
     }
 
     function bindParam(obj, key, val) {
       let isBlob = val && typeof val == "object" &&
                    val.constructor.name == "Uint8Array";
-      let args = [key, val].concat(isBlob ? [val.length] : []);
+      let args = [key, val];
+      if (isBlob)
+        args.push(val.length);
       let methodName =
         `bind${isBlob ? "Blob" : ""}By${typeof key == "number" ? "Index" : "Name"}`;
       obj[methodName](...args);
     }
 
     if (Array.isArray(params)) {
       // It's an array of separate params.
       if (params.length && (typeof(params[0]) == "object")) {