minor change to workariund a java6 profiling glitch
This commit is contained in:
parent
6bd435723f
commit
fb9334bf24
5 changed files with 8 additions and 8 deletions
|
@ -322,7 +322,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier
|
||||||
public final byte[] unify( byte[] ab, int offset, int len )
|
public final byte[] unify( byte[] ab, int offset, int len )
|
||||||
{
|
{
|
||||||
probeCacheNode.ab = null; // crc based cache lookup only
|
probeCacheNode.ab = null; // crc based cache lookup only
|
||||||
probeCacheNode.crc = Crc32.crc( ab, offset, len );
|
probeCacheNode.hash = Crc32.crc( ab, offset, len );
|
||||||
|
|
||||||
CacheNode cn = (CacheNode)cache.get( probeCacheNode );
|
CacheNode cn = (CacheNode)cache.get( probeCacheNode );
|
||||||
if ( cn != null )
|
if ( cn != null )
|
||||||
|
@ -376,7 +376,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
probeCacheNode.ab = ab;
|
probeCacheNode.ab = ab;
|
||||||
probeCacheNode.crc = Crc32.crc( ab, 0, ab.length );
|
probeCacheNode.hash = Crc32.crc( ab, 0, ab.length );
|
||||||
cn = (CacheNode)cache.get( probeCacheNode );
|
cn = (CacheNode)cache.get( probeCacheNode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier
|
||||||
{
|
{
|
||||||
cn = new CacheNode();
|
cn = new CacheNode();
|
||||||
}
|
}
|
||||||
cn.crc = probeCacheNode.crc;
|
cn.hash = probeCacheNode.hash;
|
||||||
cn.ab = ab;
|
cn.ab = ab;
|
||||||
cache.put( cn );
|
cache.put( cn );
|
||||||
|
|
||||||
|
|
|
@ -6,21 +6,20 @@ import btools.util.LruMapNode;
|
||||||
|
|
||||||
public final class CacheNode extends LruMapNode
|
public final class CacheNode extends LruMapNode
|
||||||
{
|
{
|
||||||
int crc;
|
|
||||||
byte[] ab;
|
byte[] ab;
|
||||||
float[] vars;
|
float[] vars;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
return crc;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals( Object o )
|
public boolean equals( Object o )
|
||||||
{
|
{
|
||||||
CacheNode n = (CacheNode) o;
|
CacheNode n = (CacheNode) o;
|
||||||
if ( crc != n.crc )
|
if ( hash != n.hash )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import btools.util.LruMapNode;
|
||||||
|
|
||||||
public final class VarWrapper extends LruMapNode
|
public final class VarWrapper extends LruMapNode
|
||||||
{
|
{
|
||||||
int hash;
|
|
||||||
float[] vars;
|
float[] vars;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,7 +25,7 @@ public final class LruMap
|
||||||
|
|
||||||
public LruMapNode get( LruMapNode key )
|
public LruMapNode get( LruMapNode key )
|
||||||
{
|
{
|
||||||
int bin = ( key.hashCode() & 0xfffffff ) % hashbins;
|
int bin = ( key.hash & 0xfffffff ) % hashbins;
|
||||||
|
|
||||||
LruMapNode e = binArray[bin];
|
LruMapNode e = binArray[bin];
|
||||||
while ( e != null )
|
while ( e != null )
|
||||||
|
|
|
@ -5,4 +5,6 @@ public abstract class LruMapNode
|
||||||
LruMapNode nextInBin; // next entry for hash-bin
|
LruMapNode nextInBin; // next entry for hash-bin
|
||||||
LruMapNode next; // next in lru sequence (towards mru)
|
LruMapNode next; // next in lru sequence (towards mru)
|
||||||
LruMapNode previous; // previous in lru sequence (towards lru)
|
LruMapNode previous; // previous in lru sequence (towards lru)
|
||||||
|
|
||||||
|
public int hash;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue