commit | 99e3c26d23a730ade1c1b8c2a84ea4c1bece1530 | [log] [tgz] |
---|---|---|
author | jianfeng.jia@gmail.com <jianfeng.jia@gmail.com@123451ca-8445-de46-9d55-352943316053> | Wed Mar 06 23:20:17 2013 +0000 |
committer | jianfeng.jia@gmail.com <jianfeng.jia@gmail.com@123451ca-8445-de46-9d55-352943316053> | Wed Mar 06 23:20:17 2013 +0000 |
tree | b072056f9c0e94e0fffe7e3ee37fd4f5bb9b7b2a | |
parent | 4f9bf96ee62082e659ada5cc00f2ba5c13392118 [diff] |
move the negative handler into the hashBytes() method git-svn-id: https://hyracks.googlecode.com/svn/branches/fullstack_genomix@3044 123451ca-8445-de46-9d55-352943316053
diff --git a/genomix/genomix-hyracks/src/main/java/edu/uci/ics/genomix/data/partition/KmerHashPartitioncomputerFactory.java b/genomix/genomix-hyracks/src/main/java/edu/uci/ics/genomix/data/partition/KmerHashPartitioncomputerFactory.java index 68faf59..bb6839e 100644 --- a/genomix/genomix-hyracks/src/main/java/edu/uci/ics/genomix/data/partition/KmerHashPartitioncomputerFactory.java +++ b/genomix/genomix-hyracks/src/main/java/edu/uci/ics/genomix/data/partition/KmerHashPartitioncomputerFactory.java
@@ -15,7 +15,8 @@ int hash = 1; for (int i = offset; i < offset + length; i++) hash = (31 * hash) + (int) bytes[i]; - return hash; + + return hash < 0 ? -hash: hash; } public static long getLong(byte[] bytes, int offset) { @@ -48,9 +49,6 @@ // long l = getLong(buf.array(), startOffset + fieldOffset // + slotLength); int part = hashBytes(buf.array(), startOffset + fieldOffset + slotLength, fieldLength) % nParts; - if (part < 0){ - part = -part; - } return part; } };