From b4da1ae437bb105abd96e09c32095d4366ea13d7 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 2 Dec 2014 16:35:43 -0500 Subject: [PATCH] more spec-like array sorting :eyeglasses: https://github.com/GoogleCloudPlatform/gcloud-node/pull/316\#discussion_r21193388 --- lib/datastore/transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datastore/transaction.js b/lib/datastore/transaction.js index 3c4dbf45bca3..abc7721bcbcb 100644 --- a/lib/datastore/transaction.js +++ b/lib/datastore/transaction.js @@ -182,7 +182,7 @@ Transaction.prototype.commit = function(callback) { // Group entities together by action (delete or save). .sort(function (a, b) { - return a.method > b.method; + return a.method > b.method ? 1 : a.method < b.method ? -1 : 0; }) // Group arguments together so that we only make one call to each method.