on master help sign in
shift tuple hashing of unverified tuples to mitigate vector exception (when tuple and attribute counts are not equal)
commit6dd3abdd976e5ba90d08e64dce6117f7fe64921f authorAgentM <agentm@themactionfaction.com> dateMon 16 Nov 2015, 23:18 (11 years ago) parent46b4509
1 file changed+2−4
ProjectM36/TupleSet.hs+2−4
ProjectM36/TupleSet.hs+2−4
@@ -24,12 +24,10 @@ verifyTupleSet attrs tupleSet = do
2424 if length (lefts tupleList) > 0 then
2525 Left $ head (lefts tupleList)
2626 else
27− return $ RelationTupleSet (rights tupleList)
27+ return $ RelationTupleSet $ (HS.toList . HS.fromList) (rights tupleList)
2828
2929mkTupleSet :: Attributes -> [RelationTuple] -> Either RelationalError RelationTupleSet
30−mkTupleSet attrs tuples = verifyTupleSet attrs tupSet
31− where
32− tupSet = RelationTupleSet $ (HS.toList . HS.fromList) tuples
30+mkTupleSet attrs tuples = verifyTupleSet attrs (RelationTupleSet tuples)
3331
3432mkTupleSetFromList :: Attributes -> [[Atom]] -> Either RelationalError RelationTupleSet
3533mkTupleSetFromList attrs atomMatrix = mkTupleSet attrs $ map (\atomList -> mkRelationTuple attrs (V.fromList atomList)) atomMatrix