[Pkg-javascript-commits] [backbone] 61/173: Simplify `pluck`, thanks @jridgewell.

Jonas Smedegaard dr at jones.dk
Wed Aug 31 07:44:02 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository backbone.

commit c23fb5dc4d256427c834f4c5f5da47bdd3bd1784
Author: John-David Dalton <john.david.dalton at gmail.com>
Date:   Mon Nov 23 22:28:37 2015 -0800

    Simplify `pluck`, thanks @jridgewell.
---
 backbone.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/backbone.js b/backbone.js
index c7f8d7c..d4442a3 100644
--- a/backbone.js
+++ b/backbone.js
@@ -1011,9 +1011,7 @@
 
     // Pluck an attribute from each model in the collection.
     pluck: function(attr) {
-      return _.map(this.models, function(model) {
-        return model.get(attr);
-      });
+      return this.map(attr);
     },
 
     // Fetch the default set of models for this collection, resetting the

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list