--- a/SmallSense__UnionType.st Fri Jul 14 13:39:58 2017 +0200
+++ b/SmallSense__UnionType.st Fri Jul 14 13:40:56 2017 +0200
@@ -262,17 +262,23 @@
updateTrustfullness
"Recompute the trustfullness, This is subject to tuning"
"Average if individual types"
+
+ "/ cg: taking the average is probably incorrect...
+
+ |sum|
types isEmpty ifTrue: [
- trustfullness := 1
- ] ifFalse: [
- trustfullness := (types inject: 0
- into: [:a :type | a + type trustfullness ]) / types size.
- trustfullness := trustfullness + (trustfullnessBonus ? 0).
+ trustfullness := 1.
+ ^ self.
].
+ sum := types inject: 0 into: [:a :type | a + type trustfullness ].
+ trustfullness := sum / types size.
+ trustfullness := trustfullness + (trustfullnessBonus ? 0).
+
"Created: / 17-05-2012 / 19:22:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 18-09-2013 / 01:08:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 14-07-2017 / 13:40:48 / cg"
! !
!UnionType methodsFor:'testing'!