Skip to content

Commit

Permalink
Merge pull request #264 from ArthurGazizov/master
Browse files Browse the repository at this point in the history
least/greatest improvement: Limiter
  • Loading branch information
amaembo committed Oct 22, 2022
2 parents 85c2081 + 923a170 commit 7f22178
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 7f22178

Please sign in to comment.