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
Copy file name to clipboardExpand all lines: README.md
+24-12Lines changed: 24 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,8 @@ A simple `LinkedHashSet` implementation is provided that provides basic set sema
26
26
`LinkedHashSet` provides struct enumerators for efficient, allocation-free enumeration.
27
27
28
28
```csharp
29
-
varset=newLinkedHashSet<string>() {
29
+
varset=newLinkedHashSet<string>()
30
+
{
30
31
"c",
31
32
"b",
32
33
"a",
@@ -48,7 +49,8 @@ A simple `LinkedHashMap` implementation is provided that provides full dictionar
48
49
> While preserving insertion order can be useful in certain situations, the tradeoff is that a `LinkedList` and a `Dictionary` are both used under the hood as the backing store. While this is lightweight and leverages .NET's efficient collection implementations, the linked list still allocates on the heap for every insertion and violates cache locality. For all but the most intense use cases, this will generally be acceptable where maintaining insertion order is desired. Otherwise, just use .NET's Dictionary<TKey, TValue>.
49
50
50
51
```csharp
51
-
varmap=newLinkedHashMap<string, int>() {
52
+
varmap=newLinkedHashMap<string, int>()
53
+
{
52
54
["b"] =2,
53
55
["a"] =1,
54
56
};
@@ -91,7 +93,8 @@ var table = new EntityTable<int>();
91
93
table.Set(42, "dolphins");
92
94
93
95
// Use pattern matching for an optimal experience.
94
-
if (table.Get<string>(42) is { } value) {
96
+
if (table.Get<string>(42) is { } value)
97
+
{
95
98
Console.WriteLine("Dolphins are present.");
96
99
}
97
100
@@ -105,7 +108,8 @@ var table = new EntityTable();
105
108
106
109
table.Set("identifier", newobject())
107
110
108
-
if (table.Get<object>("identifier") is { } value) {
111
+
if (table.Get<object>("identifier") is { } value)
112
+
{
109
113
Console.WriteLine("Object is present.");
110
114
}
111
115
```
@@ -117,8 +121,10 @@ The boxless queue allows you to queue struct values on the heap without boxing t
117
121
To do so, you must make an object which implements the `IBoxlessValueHandler` interface. The `HandleValue` method will be invoked whenever the boxless queue dequeues a value.
@@ -135,7 +141,8 @@ Once you have implemented the `IBoxlessValueHandler`, you can create a boxless q
135
141
queue.Enqueue(valueA);
136
142
137
143
// See if anything is in the queue.
138
-
if (queue.HasValues) {
144
+
if (queue.HasValues)
145
+
{
139
146
Console.WriteLine("Something in the queue.");
140
147
}
141
148
@@ -150,7 +157,8 @@ A simple object pool implementation is provided that allows you to pre-allocate
150
157
Any object you wish to store in a pool must conform to `IPooled` and implement the required `Reset` method. The reset method is called when the object is returned to the pool, allowing you to reset the object's state.
151
158
152
159
```csharp
153
-
publicabstractclassShape : IPooled {
160
+
publicabstractclassShape : IPooled
161
+
{
154
162
publicvoidReset() { }
155
163
}
156
164
@@ -188,7 +196,8 @@ A pool can be easily created. Each derived type that you wish to pool can be "re
188
196
A typed facade over `OrderedDictionary`. Provides a basic mechanism to store strongly typed keys and values while preserving key insertion order.
189
197
190
198
```csharp
191
-
varmap=newMap<string, int>() {
199
+
varmap=newMap<string, int>()
200
+
{
192
201
["b"] =2,
193
202
["a"] =1,
194
203
};
@@ -208,21 +217,24 @@ AutoProps are basically a simplified version of a `BehaviorSubject` that only up
0 commit comments