Commit 8be9bd1
src: remove extra heap allocation in GetSession()
Don't allocate + copy + free; allocate and fill in place, then hand off
the pointer to Buffer::New().
Avoids unnecessary heap allocations in the following methods:
- crypto.CryptoStream#getSession()
- tls.TLSSocket#getSession()
PR-URL: #14122
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>1 parent 8dd6866 commit 8be9bd1
1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1804 | 1804 | | |
1805 | 1805 | | |
1806 | 1806 | | |
1807 | | - | |
| 1807 | + | |
1808 | 1808 | | |
1809 | 1809 | | |
1810 | | - | |
1811 | | - | |
| 1810 | + | |
1812 | 1811 | | |
1813 | 1812 | | |
1814 | 1813 | | |
| |||
0 commit comments