int compare(OptMapInfo m) { if (m.value <= 0) return -1; int ve = COMP_EM_BASE * length * (ignoreCase > 0 ? 1 : 2); int vm = COMP_EM_BASE * 5 * 2 / m.value; return mmd.compareDistanceValue(m.mmd, ve, vm); } }
int compare(OptMapInfo m) { if (m.value <= 0) return -1; int ve = COMP_EM_BASE * length * (ignoreCase > 0 ? 1 : 2); int vm = COMP_EM_BASE * 5 * 2 / m.value; return mmd.compareDistanceValue(m.mmd, ve, vm); } }
void select(OptMapInfo alt) { if (alt.value == 0) return; if (value == 0) { copy(alt); return; } int v1 = z / value; int v2 = z /alt.value; if (mmd.compareDistanceValue(alt.mmd, v1, v2) > 0) copy(alt); }
void select(OptMapInfo alt) { if (alt.value == 0) return; if (value == 0) { copy(alt); return; } int v1 = z / value; int v2 = z /alt.value; if (mmd.compareDistanceValue(alt.mmd, v1, v2) > 0) copy(alt); }
void select(OptExactInfo alt, Encoding enc) { int v1 = length; int v2 = alt.length; if (v2 == 0) { return; } else if (v1 == 0) { copy(alt); return; } else if (v1 <= 2 && v2 <= 2) { /* ByteValTable[x] is big value --> low price */ v2 = OptMapInfo.positionValue(enc, bytes[0] & 0xff); v1 = OptMapInfo.positionValue(enc, alt.bytes[0] & 0xff); if (length > 1) v1 += 5; if (alt.length > 1) v2 += 5; } if (ignoreCase <= 0) v1 *= 2; if (alt.ignoreCase <= 0) v2 *= 2; if (mmd.compareDistanceValue(alt.mmd, v1, v2) > 0) copy(alt); }
void select(OptExactInfo alt, Encoding enc) { int v1 = length; int v2 = alt.length; if (v2 == 0) { return; } else if (v1 == 0) { copy(alt); return; } else if (v1 <= 2 && v2 <= 2) { /* ByteValTable[x] is big value --> low price */ v2 = OptMapInfo.positionValue(enc, bytes[0] & 0xff); v1 = OptMapInfo.positionValue(enc, alt.bytes[0] & 0xff); if (length > 1) v1 += 5; if (alt.length > 1) v2 += 5; } if (ignoreCase <= 0) v1 *= 2; if (alt.ignoreCase <= 0) v2 *= 2; if (mmd.compareDistanceValue(alt.mmd, v1, v2) > 0) copy(alt); }