Compare methods changed to compare index relevant fields only, to make reusable for search purposes

This commit is contained in:
Simon Rozman 2016-03-03 16:08:07 +01:00
parent 0ec73e44ca
commit 70990846e1
2 changed files with 2 additions and 8 deletions

View File

@ -111,9 +111,6 @@ namespace ZRCola {
int r = translation::CompareString(trans_a.str, trans_a.str_len, trans_b.str, trans_b.str_len);
if (r != 0) return r;
if (trans_a.chr < trans_b.chr) return -1;
else if (trans_a.chr > trans_b.chr) return +1;
return 0;
}
} idxComp; ///< Composition index
@ -152,7 +149,7 @@ namespace ZRCola {
if (trans_a.chr < trans_b.chr) return -1;
else if (trans_a.chr > trans_b.chr) return +1;
return translation::CompareString(trans_a.str, trans_a.str_len, trans_b.str, trans_b.str_len);
return 0;
}
} idxDecomp; ///< Decomposition index

View File

@ -119,7 +119,7 @@ namespace ZRCola {
if (ks_a.chr < ks_b.chr) return -1;
else if (ks_a.chr > ks_b.chr) return +1;
return keyseq::CompareSequence(ks_a.seq, ks_a.seq_len, ks_b.seq, ks_b.seq_len);
return 0;
}
} idxChr; ///< Character index
@ -157,9 +157,6 @@ namespace ZRCola {
int r = keyseq::CompareSequence(ks_a.seq, ks_a.seq_len, ks_b.seq, ks_b.seq_len);
if (r != 0) return r;
if (ks_a.chr < ks_b.chr) return -1;
else if (ks_a.chr > ks_b.chr) return +1;
return 0;
}
} idxKey; ///< Key index