Commit 6acff8f
committed
http: code cleanup & dry
The first change in `_writeRaw`:
This reduces drops an unnecessary if check (`outputLength`),
because it is redone in `_flushOutput`. It also changes an if/else
statement to an if statement, because the blocks were unrelated.
The second change in `write`:
This consolidates code in #write() that handled different
string encodings and Buffers. There was no reason to handle the
encodings differently, so after splitting them based on Buffer vs
encoding, the code is consolidated. This might see a speedup. Shoutout
to Ron Korving <[email protected]> for spotting this.1 parent cb96305 commit 6acff8f
1 file changed
+11
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
| 475 | + | |
479 | 476 | | |
480 | | - | |
481 | | - | |
482 | 477 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
| 478 | + | |
493 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
494 | 485 | | |
495 | 486 | | |
496 | 487 | | |
| |||
0 commit comments