Kaynağa Gözat

EAGLESIX-2713: All test cases pass

Jake Delaney 11 yıl önce
ebeveyn
işleme
ab4d04a4bb

+ 6 - 9
lib/pipeline/expressions/SetDifferenceExpression.js

@@ -24,8 +24,7 @@ var SetDifferenceExpression = module.exports = function SetDifferenceExpression(
 
 // DEPENDENCIES
 var Value = require("../Value"),
-	Expression = require("./Expression"),
-	Helpers = require("./Helpers")
+	Expression = require("./Expression");
 
 // PROTOTYPE MEMBERS
 proto.getOpName = function getOpName() {
@@ -33,7 +32,7 @@ proto.getOpName = function getOpName() {
 };
 
 /**
- * Takes 2 arrays. Returns the difference
+ * Takes 2 arrays. Assigns the second array to the first array.
  * @method evaluateInternal
  **/
 proto.evaluateInternal = function evaluateInternal(vars) {
@@ -43,16 +42,14 @@ proto.evaluateInternal = function evaluateInternal(vars) {
 	if (!(array1 instanceof Array)) throw new Error(this.getOpName() + ": object 1 must be an array");
 	if (!(array2 instanceof Array)) throw new Error(this.getOpName() + ": object 2 must be an array");
 
-	var rhsSet = Helpers.arrayToSet(rhs),
-		returnVec = [];
+	var returnVec = [];
 
-	lhs.forEach(function(key) {
-		if (-1 === rhsSet.indexOf(key)) {
+	array1.forEach(function(key) {
+		if (-1 === array2.indexOf(key)) {
 			returnVec.push(key);
 		}
 	}, this);
-
-	return Value.consume(returnVec);
+	return returnVec;
 };
 
 /** Register Expression */