diff --git a/Hazel/ObjectPool.cs b/Hazel/ObjectPool.cs index 510e55a..0a418cc 100644 --- a/Hazel/ObjectPool.cs +++ b/Hazel/ObjectPool.cs @@ -13,11 +13,11 @@ namespace Hazel public sealed class ObjectPool where T : IRecyclable { private int numberCreated; - public int NumberCreated { get { return numberCreated; } } + public int NumberCreated => this.numberCreated; - public int NumberInUse { get { return this.inuse.Count; } } - public int NumberNotInUse { get { return this.pool.Count; } } - public int Size { get { return this.NumberInUse + this.NumberNotInUse; } } + public int NumberInUse => this.inuse.Count; + public int NumberNotInUse => this.pool.Count; + public int Size => this.NumberInUse + this.NumberNotInUse; #if HAZEL_BAG private readonly ConcurrentBag pool = new ConcurrentBag(); @@ -33,11 +33,11 @@ public sealed class ObjectPool where T : IRecyclable /// /// private readonly Func objectFactory; - + /// /// Internal constructor for our ObjectPool. /// - internal ObjectPool(Func objectFactory) + public ObjectPool(Func objectFactory) { this.objectFactory = objectFactory; } @@ -46,7 +46,7 @@ internal ObjectPool(Func objectFactory) /// Returns a pooled object of type T, if none are available another is created. /// /// An instance of T. - internal T GetObject() + public T GetObject() { #if HAZEL_BAG if (!pool.TryTake(out T item)) @@ -84,7 +84,7 @@ internal T GetObject() /// Returns an object to the pool. /// /// The item to return. - internal void PutObject(T item) + public void PutObject(T item) { if (inuse.TryRemove(item, out bool b)) {