Skip to content

Commit b4ff633

Browse files
author
Alex Peck
committed
api docs
1 parent 9491e47 commit b4ff633

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

BitFaster.Caching/Lfu/ConcurrentLfu.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,11 @@ public bool TryGet(K key, out V value)
318318
return false;
319319
}
320320

321+
/// <summary>
322+
/// Attempts to remove the specified key value pair.
323+
/// </summary>
324+
/// <param name="item">The item to remove.</param>
325+
/// <returns>true if the item was removed successfully; otherwise, false.</returns>
321326
public bool TryRemove(KeyValuePair<K, V> item)
322327
{
323328
if (this.dictionary.TryGetValue(item.Key, out var node))
@@ -340,8 +345,14 @@ public bool TryRemove(KeyValuePair<K, V> item)
340345
}
341346

342347
return false;
343-
}
344-
348+
}
349+
350+
/// <summary>
351+
/// Attempts to remove and return the value that has the specified key.
352+
/// </summary>
353+
/// <param name="key">The key of the element to remove.</param>
354+
/// <param name="value">When this method returns, contains the object removed, or the default value of the value type if key does not exist.</param>
355+
/// <returns>true if the object was removed successfully; otherwise, false.</returns>
345356
public bool TryRemove(K key, out V value)
346357
{
347358
if (this.dictionary.TryRemove(key, out var node))

BitFaster.Caching/Lru/ClassicLru.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,13 @@ public async ValueTask<V> GetOrAddAsync<TArg>(K key, Func<K, TArg, Task<V>> valu
235235
}
236236

237237
return await this.GetOrAddAsync(key, valueFactory, factoryArgument);
238-
}
239-
238+
}
239+
240+
/// <summary>
241+
/// Attempts to remove the specified key value pair.
242+
/// </summary>
243+
/// <param name="item">The item to remove.</param>
244+
/// <returns>true if the item was removed successfully; otherwise, false.</returns>
240245
public bool TryRemove(KeyValuePair<K, V> item)
241246
{
242247
if (this.dictionary.TryGetValue(item.Key, out var node))
@@ -258,8 +263,14 @@ public bool TryRemove(KeyValuePair<K, V> item)
258263
}
259264

260265
return false;
261-
}
262-
266+
}
267+
268+
/// <summary>
269+
/// Attempts to remove and return the value that has the specified key.
270+
/// </summary>
271+
/// <param name="key">The key of the element to remove.</param>
272+
/// <param name="value">When this method returns, contains the object removed, or the default value of the value type if key does not exist.</param>
273+
/// <returns>true if the object was removed successfully; otherwise, false.</returns>
263274
public bool TryRemove(K key, out V value)
264275
{
265276
if (dictionary.TryRemove(key, out var node))

BitFaster.Caching/Lru/ConcurrentLruCore.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,12 @@ public async ValueTask<V> GetOrAddAsync<TArg>(K key, Func<K, TArg, Task<V>> valu
292292
}
293293
}
294294
}
295-
295+
296+
/// <summary>
297+
/// Attempts to remove the specified key value pair.
298+
/// </summary>
299+
/// <param name="item">The item to remove.</param>
300+
/// <returns>true if the item was removed successfully; otherwise, false.</returns>
296301
public bool TryRemove(KeyValuePair<K, V> item)
297302
{
298303
if (this.dictionary.TryGetValue(item.Key, out var existing))
@@ -317,6 +322,12 @@ public bool TryRemove(KeyValuePair<K, V> item)
317322
return false;
318323
}
319324

325+
/// <summary>
326+
/// Attempts to remove and return the value that has the specified key.
327+
/// </summary>
328+
/// <param name="key">The key of the element to remove.</param>
329+
/// <param name="value">When this method returns, contains the object removed, or the default value of the value type if key does not exist.</param>
330+
/// <returns>true if the object was removed successfully; otherwise, false.</returns>
320331
public bool TryRemove(K key, out V value)
321332
{
322333
if (this.dictionary.TryRemove(key, out var item))

0 commit comments

Comments
 (0)