提交 ff1a2ce9 authored 作者: Thomas Mueller's avatar Thomas Mueller

Possible slight optimization

上级 447cdcf7
......@@ -152,6 +152,11 @@ public final class CompressLZF implements Compressor {
int off = hash(future);
int ref = hashTab[off];
hashTab[off] = inPos;
// if (ref < inPos
// && ref > 0
// && (off = inPos - ref - 1) < MAX_OFF
// && in[ref + 2] == p2
// && (((in[ref] & 255) << 8) | (in[ref + 1] & 255)) == ((future >> 8) & 0xffff)) {
if (ref < inPos
&& ref > 0
&& (off = inPos - ref - 1) < MAX_OFF
......@@ -230,6 +235,7 @@ public final class CompressLZF implements Compressor {
}
public void expand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen) {
// if ((inPos | outPos | outLen) < 0) {
if (inPos < 0 || outPos < 0 || outLen < 0) {
throw new IllegalArgumentException();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论