Browse files

Reduced code in Concat and Intersect.

  • Loading branch information...
1 parent 226fc43 commit e17a51bf0dcacc89dcca789a448ba1be865d9e47 @scottgonzalez scottgonzalez committed May 5, 2010
Showing with 2 additions and 9 deletions.
  1. +2 −9 lib/JSLINQ.js
View
11 lib/JSLINQ.js
@@ -139,17 +139,10 @@
return this.items[index];
},
Concat: function(array) {
- var arr = array.items || array;
- return new JSLINQ(this.items.concat(arr));
+ return new JSLINQ(this.items.concat(array.items || array));
},
Intersect: function(secondArray, clause) {
- var clauseMethod;
- if (clause != undefined) {
- clauseMethod = clause;
- } else {
- clauseMethod = function(item, index, item2, index2) { return item == item2; };
- }
-
+ var clauseMethod = clause || function(item, index, item2, index2) { return item == item2; };
var sa = secondArray.items || secondArray;
var result = [];

0 comments on commit e17a51b

Please sign in to comment.