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
// peek(1) to peek the next elem to be popped, peek(2) peeks the second next element to be popped.
161
+
peek(nth: number): T|undefined{
162
+
returnthis.store[nth-1];
163
+
}
164
+
pop(): T|undefined{
165
+
returnthis.store.shift();
166
+
// yes, I know what you want to say, it has O(n) time complexity.
167
+
// it doesn't really matter if there is only like 100 people in home queue at most.
168
+
// if you really care about performance, why don't you go and limit the amount of people to fetch? that probably has significantly more impact to the performance.
0 commit comments