Compare methods changed to compare index relevant fields only, to make reusable for search purposes
This commit is contained in:
parent
0ec73e44ca
commit
70990846e1
@ -111,9 +111,6 @@ namespace ZRCola {
|
|||||||
int r = translation::CompareString(trans_a.str, trans_a.str_len, trans_b.str, trans_b.str_len);
|
int r = translation::CompareString(trans_a.str, trans_a.str_len, trans_b.str, trans_b.str_len);
|
||||||
if (r != 0) return r;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
} idxComp; ///< Composition index
|
} idxComp; ///< Composition index
|
||||||
@ -152,7 +149,7 @@ namespace ZRCola {
|
|||||||
if (trans_a.chr < trans_b.chr) return -1;
|
if (trans_a.chr < trans_b.chr) return -1;
|
||||||
else 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
|
} idxDecomp; ///< Decomposition index
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ namespace ZRCola {
|
|||||||
if (ks_a.chr < ks_b.chr) return -1;
|
if (ks_a.chr < ks_b.chr) return -1;
|
||||||
else 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
|
} 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);
|
int r = keyseq::CompareSequence(ks_a.seq, ks_a.seq_len, ks_b.seq, ks_b.seq_len);
|
||||||
if (r != 0) return r;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
} idxKey; ///< Key index
|
} idxKey; ///< Key index
|
||||||
|
Loading…
x
Reference in New Issue
Block a user