fix: allow popups with popped-out tabs

This commit is contained in:
Anna
2022-05-13 10:56:36 -04:00
parent d84aba280f
commit de0309e428
2 changed files with 34 additions and 7 deletions
+23
View File
@@ -0,0 +1,23 @@
namespace ChatTwo.Util;
internal class Lender<T> {
private readonly Func<T> _ctor;
private readonly List<T> _items = new();
private int _counter;
internal Lender(Func<T> ctor) {
this._ctor = ctor;
}
internal void ResetCounter() {
this._counter = 0;
}
internal T Borrow() {
if (this._items.Count <= this._counter) {
this._items.Add(this._ctor());
}
return this._items[this._counter++];
}
}