Skip to content

Commit

Permalink
least/greatest improvement: Limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurGazizov committed Oct 19, 2022
1 parent 85c2081 commit 923a170
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/one/util/streamex/Limiter.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public boolean put(T t) {
* @return this object
*/
public Limiter<T> putAll(Limiter<T> ls) {
if (initial && (size + ls.size <= data.length)){
System.arraycopy(ls.data, 0, data, size, ls.size);
size += ls.size;
return this;
}
int i = 0;
if (!ls.initial) {
// sorted part
Expand Down

0 comments on commit 923a170

Please sign in to comment.