Skip to content

Commit 3aa1916

Browse files
committed
Use _.uniq to get unique contributors array from git history instead of manually forEach'ing.
1 parent 53d12db commit 3aa1916

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

grunt.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,8 @@ grunt.registerHelper( "contributor-attribution", function( post, fileName, fn )
100100
grunt.log.error( err );
101101
return;
102102
}
103-
// make unique.)
104-
result.stdout.split( /\r?\n/g ).forEach(function(line) {
105-
if ( _.contains( contribs, line ) ) {
106-
return;
107-
}
108-
contribs.push(line);
109-
});
103+
// make unique.
104+
contribs = _.uniq( result.stdout.split( /\r?\n/g ) );
110105

111106
// make object { name: 'name', email: 'email@address.com' }
112107
contribs.forEach(function(str, idx) {

0 commit comments

Comments
 (0)