minor change to workariund a java6 profiling glitch

This commit is contained in:
Arndt Brenschede 2018-12-16 13:32:16 +01:00
parent 6bd435723f
commit fb9334bf24
5 changed files with 8 additions and 8 deletions

View file

@ -322,7 +322,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier
public final byte[] unify( byte[] ab, int offset, int len )
{
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 );
if ( cn != null )
@ -376,7 +376,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier
else
{
probeCacheNode.ab = ab;
probeCacheNode.crc = Crc32.crc( ab, 0, ab.length );
probeCacheNode.hash = Crc32.crc( ab, 0, ab.length );
cn = (CacheNode)cache.get( probeCacheNode );
}
@ -389,7 +389,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier
{
cn = new CacheNode();
}
cn.crc = probeCacheNode.crc;
cn.hash = probeCacheNode.hash;
cn.ab = ab;
cache.put( cn );

View file

@ -6,21 +6,20 @@ import btools.util.LruMapNode;
public final class CacheNode extends LruMapNode
{
int crc;
byte[] ab;
float[] vars;
@Override
public int hashCode()
{
return crc;
return hash;
}
@Override
public boolean equals( Object o )
{
CacheNode n = (CacheNode) o;
if ( crc != n.crc )
if ( hash != n.hash )
{
return false;
}

View file

@ -6,7 +6,6 @@ import btools.util.LruMapNode;
public final class VarWrapper extends LruMapNode
{
int hash;
float[] vars;
@Override

View file

@ -25,7 +25,7 @@ public final class LruMap
public LruMapNode get( LruMapNode key )
{
int bin = ( key.hashCode() & 0xfffffff ) % hashbins;
int bin = ( key.hash & 0xfffffff ) % hashbins;
LruMapNode e = binArray[bin];
while ( e != null )

View file

@ -5,4 +5,6 @@ public abstract class LruMapNode
LruMapNode nextInBin; // next entry for hash-bin
LruMapNode next; // next in lru sequence (towards mru)
LruMapNode previous; // previous in lru sequence (towards lru)
public int hash;
}