Consider empty key in HashContext.keyInit()

This commit is contained in:
leventov
2015-02-13 13:38:18 +07:00
parent c8f61e3275
commit 3c89f05e81
@@ -389,7 +389,7 @@ public abstract class HashContext<K, KI, MKI extends MetaBytesInterop<K, ? super
// Key
K key;
public MKI metaKeyInterop;
public long keySize;
public long keySize = -1;
public void initKey(K key) {
initKeyDependencies();
@@ -397,7 +397,7 @@ public abstract class HashContext<K, KI, MKI extends MetaBytesInterop<K, ? super
}
public boolean keyInit() {
return keySize != 0;
return keySize >= 0;
}
public void initKeyDependencies() {
@@ -430,7 +430,7 @@ public abstract class HashContext<K, KI, MKI extends MetaBytesInterop<K, ? super
}
public void closeKey0() {
keySize = 0;
keySize = -1;
metaKeyInterop = null;
key = null;
}