fix: allow popups with popped-out tabs

This commit is contained in:
Anna committed 2022-05-13 10:56:36 -04:00
1 parent d84aba280f
commit de0309e428
2 files changed
+34 -7

No files matched your search

+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++];
}
}