remove useless casts

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1003870 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-10-02 19:26:36 +00:00
parent 9a7eb4e2b3
commit cdc93f3b79
2 changed files with 6 additions and 6 deletions

View File

@ -304,7 +304,7 @@ public final class FuzzyTermsEnum extends TermsEnum {
final float similarity = 1.0f - ((float) i / (float) final float similarity = 1.0f - ((float) i / (float)
(Math.min(codePointCount, termLength))); (Math.min(codePointCount, termLength)));
if (similarity > minSimilarity) { if (similarity > minSimilarity) {
boostAtt.setBoost((float) ((similarity - minSimilarity) * scale_factor)); boostAtt.setBoost((similarity - minSimilarity) * scale_factor);
return AcceptStatus.YES_AND_SEEK; return AcceptStatus.YES_AND_SEEK;
} else { } else {
return AcceptStatus.NO_AND_SEEK; return AcceptStatus.NO_AND_SEEK;
@ -380,7 +380,7 @@ public final class FuzzyTermsEnum extends TermsEnum {
UnicodeUtil.UTF8toUTF32(term, utf32); UnicodeUtil.UTF8toUTF32(term, utf32);
final float similarity = similarity(utf32.ints, realPrefixLength, utf32.length - realPrefixLength); final float similarity = similarity(utf32.ints, realPrefixLength, utf32.length - realPrefixLength);
if (similarity > minSimilarity) { if (similarity > minSimilarity) {
boostAtt.setBoost((float)((similarity - minSimilarity) * scale_factor)); boostAtt.setBoost((similarity - minSimilarity) * scale_factor);
return AcceptStatus.YES; return AcceptStatus.YES;
} else return AcceptStatus.NO; } else return AcceptStatus.NO;
} else { } else {

View File

@ -101,7 +101,7 @@ public final class PagedBytes {
b.length = block[offset]; b.length = block[offset];
b.offset = offset+1; b.offset = offset+1;
} else { } else {
b.length = (((int) (block[offset] & 0x7f)) << 8) | (block[1+offset] & 0xff); b.length = ((block[offset] & 0x7f) << 8) | (block[1+offset] & 0xff);
b.offset = offset+2; b.offset = offset+2;
assert b.length > 0; assert b.length > 0;
} }
@ -118,7 +118,7 @@ public final class PagedBytes {
b.length = block[offset]; b.length = block[offset];
b.offset = offset+1; b.offset = offset+1;
} else { } else {
b.length = (((int) (block[offset] & 0x7f)) << 8) | (block[1+offset] & 0xff); b.length = ((block[offset] & 0x7f) << 8) | (block[1+offset] & 0xff);
b.offset = offset+2; b.offset = offset+2;
assert b.length > 0; assert b.length > 0;
} }
@ -138,7 +138,7 @@ public final class PagedBytes {
b.offset = offset+1; b.offset = offset+1;
start += 1L + b.length; start += 1L + b.length;
} else { } else {
b.length = (((int) (block[offset] & 0x7f)) << 8) | (block[1+offset] & 0xff); b.length = ((block[offset] & 0x7f) << 8) | (block[1+offset] & 0xff);
b.offset = offset+2; b.offset = offset+2;
start += 2L + b.length; start += 2L + b.length;
assert b.length > 0; assert b.length > 0;
@ -216,7 +216,7 @@ public final class PagedBytes {
byteCount -= left; byteCount -= left;
bytesUpto += left; bytesUpto += left;
} else { } else {
System.arraycopy(bytes.bytes, bytesUpto, currentBlock, upto, (int) byteCount); System.arraycopy(bytes.bytes, bytesUpto, currentBlock, upto, byteCount);
upto += byteCount; upto += byteCount;
break; break;
} }