Improved Bindings.getBinding(Class) caching for Datatype.class
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / binding / VariantBinding.java
index 30fe63ffae1ee7ae4d0472add679a5a1d2c91100..60e01409020d399d2f15c1ac2083960a8eed9e06 100644 (file)
@@ -174,11 +174,10 @@ public abstract class VariantBinding extends Binding {
 
     @Override
     public int deepHashValue(Object value, IdentityHashMap<Object, Object> hashedObjects) throws BindingException {
-               Datatype type = getContentType(value);          
+               Datatype type = getContentType(value);
                Binding binding = getContentBinding(value);
-               Binding dataTypeBinding = Bindings.getBindingUnchecked(Datatype.class);
        Object element = getContent(value, binding);
-       return dataTypeBinding.deepHashValue(type, hashedObjects) + binding.deepHashValue(element, hashedObjects);
+       return Bindings.DATATYPE.deepHashValue(type, hashedObjects) + binding.deepHashValue(element, hashedObjects);
     }
 
        @Override
@@ -188,8 +187,7 @@ public abstract class VariantBinding extends Binding {
                // Compare Type
                Datatype t1 = getContentType(o1);
                Datatype t2 = getContentType(o2);
-               Binding dataTypeBinding = Bindings.getBindingUnchecked(Datatype.class);
-               int dif = dataTypeBinding.compare(t1, t2);
+               int dif = Bindings.DATATYPE.compare(t1, t2);
                if (dif!=0) return dif;
                // Compare Value
                Binding bi1 = getContentBinding(o1);