Commit df97c9d
committed
Reduce branching in write_vectored for BufWriter
Do what write does and optimize for the most likely case:
slices are much smaller than the buffer. If a slice does not fit
completely in the remaining capacity of the buffer, it is left out
rather than buffered partially. Special treatment is only left for
oversized slices that are written directly to the underlying writer.1 parent 09067fc commit df97c9d
1 file changed
+9
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
347 | 346 | | |
348 | | - | |
| 347 | + | |
349 | 348 | | |
350 | 349 | | |
351 | 350 | | |
| |||
360 | 359 | | |
361 | 360 | | |
362 | 361 | | |
363 | | - | |
| 362 | + | |
364 | 363 | | |
365 | | - | |
366 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
367 | 368 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 369 | + | |
373 | 370 | | |
374 | 371 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 372 | + | |
| 373 | + | |
379 | 374 | | |
380 | 375 | | |
381 | 376 | | |
| |||
0 commit comments