Skip to content

Commit 6f72bd2

Browse files
committed
renamed OrderedSet to LinkedHashSet
1 parent d8903f9 commit 6f72bd2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

com.unity.perception/Runtime/Randomization/Randomizers/OrderedSet.cs renamed to com.unity.perception/Runtime/Randomization/Randomizers/LinkedHashSet.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ namespace UnityEngine.Perception.Randomization.Randomizers
99
/// O(1) lookup, O(1) insertion, O(1) removal, and O(n) traversal
1010
/// </summary>
1111
/// <typeparam name="T">The item type to store in this collection</typeparam>
12-
class OrderedSet<T> : ICollection<T>
12+
class LinkedHashSet<T> : ICollection<T>
1313
{
1414
readonly IDictionary<T, LinkedListNode<T>> m_Dictionary;
1515
readonly LinkedList<T> m_LinkedList;
1616

17-
public OrderedSet() : this(EqualityComparer<T>.Default) { }
17+
public LinkedHashSet() : this(EqualityComparer<T>.Default) { }
1818

19-
public OrderedSet(IEqualityComparer<T> comparer)
19+
public LinkedHashSet(IEqualityComparer<T> comparer)
2020
{
2121
m_Dictionary = new Dictionary<T, LinkedListNode<T>>(comparer);
2222
m_LinkedList = new LinkedList<T>();
2323
}
2424

2525
public int Count => m_Dictionary.Count;
2626

27-
public virtual bool IsReadOnly => m_Dictionary.IsReadOnly;
27+
public bool IsReadOnly => m_Dictionary.IsReadOnly;
2828

2929
void ICollection<T>.Add(T item)
3030
{
File renamed without changes.

com.unity.perception/Runtime/Randomization/Randomizers/RandomizerTagManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class RandomizerTagManager
1414
public static RandomizerTagManager singleton { get; } = new RandomizerTagManager();
1515

1616
Dictionary<Type, HashSet<Type>> m_TypeTree = new Dictionary<Type, HashSet<Type>>();
17-
Dictionary<Type, OrderedSet<RandomizerTag>> m_TagMap = new Dictionary<Type, OrderedSet<RandomizerTag>>();
17+
Dictionary<Type, LinkedHashSet<RandomizerTag>> m_TagMap = new Dictionary<Type, LinkedHashSet<RandomizerTag>>();
1818

1919
/// <summary>
2020
/// Enumerates over all RandomizerTags of the given type present in the scene
@@ -60,15 +60,15 @@ void AddTagTypeToTypeHierarchy(Type tagType)
6060
if (m_TypeTree.ContainsKey(tagType))
6161
return;
6262

63-
m_TagMap.Add(tagType, new OrderedSet<RandomizerTag>());
63+
m_TagMap.Add(tagType, new LinkedHashSet<RandomizerTag>());
6464
m_TypeTree.Add(tagType, new HashSet<Type>());
6565

6666
var baseType = tagType.BaseType;
6767
while (baseType != null && baseType != typeof(RandomizerTag))
6868
{
6969
if (!m_TypeTree.ContainsKey(baseType))
7070
{
71-
m_TagMap.Add(baseType, new OrderedSet<RandomizerTag>());
71+
m_TagMap.Add(baseType, new LinkedHashSet<RandomizerTag>());
7272
m_TypeTree[baseType] = new HashSet<Type> { tagType };
7373
}
7474
else

0 commit comments

Comments
 (0)