var util=require("./util");function generatedPositionAfter(t,e){var r=t.generatedLine,i=e.generatedLine,a=t.generatedColumn,n=e.generatedColumn;return i>r||i==r&&n>=a||util.compareByGeneratedPositionsInflated(t,e)<=0}function MappingList(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function(t,e){this._array.forEach(t,e)},MappingList.prototype.add=function(t){generatedPositionAfter(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},MappingList.prototype.toArray=function(){return this._sorted||(this._array.sort(util.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},exports.MappingList=MappingList;