Add a pending change, potentially combining with existing ones.
(&mut self, change: PendingChange)
| 255 | |
| 256 | /// Add a pending change, potentially combining with existing ones. |
| 257 | fn add_pending(&mut self, change: PendingChange) { |
| 258 | // Check if we can combine with the last pending change |
| 259 | if let Some(last) = self.pending.last() { |
| 260 | if last.can_combine_with(&change, self.options.combine_threshold) { |
| 261 | let combined = last.combine_with(&change); |
| 262 | self.pending.pop(); |
| 263 | self.pending.push(combined); |
| 264 | return; |
| 265 | } |
| 266 | } |
| 267 | self.pending.push(change); |
| 268 | } |
| 269 | |
| 270 | /// Finish building and return the result. |
| 271 | /// |
no test coverage detected