/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{removeUnordered as o}from"../../../../../core/arrayUtils.js";import t from"../../../../../core/ObjectPool.js";class r{constructor(o=0,t=0){this.from=o,this.to=t}get numElements(){return this.to-this.from}}function e(t,r=s){if(t.length<2)return;const e=new Map;for(const o of t)e.set(o.from,o);let n=!0;for(;n;){n=!1;for(const s of t){const f=e.get(s.to);f&&(s.to=f.to,e.delete(f.from),o(t,f),n=!0,r.release(f))}}}const s=new t(()=>new r,(o,t=0,r=0)=>{o.from=t,o.to=r},()=>{});export{r as BufferRange,s as bufferRangePool,e as mergeAdjacentRanges};
