You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, when getting a Chance, the assumption is that if it is not there, it's zero. That's what we want. However, when we set a chance to zero, we add it to the dictionary, potentially resulting in a large number of entries with Chance.zero as their values. This is unnecessary, could potentially be detrimental (storage space), and is internally inconsistent. I think it doesn't actually have an outward-facing effect, because we filter out chances that are not greater than zero:
Samasaur1
changed the title
Setting individual chances in Changes has inconsistent behavior
Setting individual chances in Chances has inconsistent behavior
Dec 26, 2020
Here's the getter/setter for what I'm talking about.
DiceKit/Sources/DiceKit/Chances.swift
Lines 52 to 59 in d67f52f
As you can see, when getting a
Chance
, the assumption is that if it is not there, it's zero. That's what we want. However, when we set a chance to zero, we add it to the dictionary, potentially resulting in a large number of entries withChance.zero
as their values. This is unnecessary, could potentially be detrimental (storage space), and is internally inconsistent. I think it doesn't actually have an outward-facing effect, because we filter out chances that are not greater than zero:DiceKit/Sources/DiceKit/Chances.swift
Line 27 in d67f52f
but we could and probably should still change this.
The text was updated successfully, but these errors were encountered: