reflections/shape/shape.js
function addPatch(patches, patch) {
	var lastPatch = patches[patches.length -1];
	if(lastPatch) {
		// same number of deletes and counts as the index is back
		if(lastPatch.deleteCount === lastPatch.insert.length && (patch.index - lastPatch.index === lastPatch.deleteCount) ) {
			lastPatch.insert.push.apply(lastPatch.insert, patch.insert);
			lastPatch.deleteCount += patch.deleteCount;
			return;
		}
	}
	patches.push(patch);
}
function addPatch(patches, patch) {
	var lastPatch = patches[patches.length -1];
	if(lastPatch) {
		// same number of deletes and counts as the index is back
		if(lastPatch.deleteCount === lastPatch.insert.length && (patch.index - lastPatch.index === lastPatch.deleteCount) ) {
			lastPatch.insert.push.apply(lastPatch.insert, patch.insert);
			lastPatch.deleteCount += patch.deleteCount;
			return;
		}
	}
	patches.push(patch);
}
function addPatch ( patches , patch ) { var lastPatch = patches [ patches . length - 1 ] ; if ( lastPatch ) { // same number of deletes and counts as the index is back if ( lastPatch . deleteCount === lastPatch . insert . length && ( patch . index - lastPatch . index === lastPatch . deleteCount ) ) { lastPatch . insert . push . apply ( lastPatch . insert , patch . insert ) ; lastPatch . deleteCount += patch . deleteCount ; return ; } } patches . push ( patch ) ; }
combines patches if it makes sense
combines patches if it makes sense