diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-03-25 15:02:23 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-03-30 14:30:40 +0200 |
commit | ae70e2bc34aca8b581f53eb49a27460ac1fc3f83 (patch) | |
tree | ba096f4af3e1b294266f5259432310c8e0f9b8b3 /tools/doc/addon-verify.js | |
parent | b7cfd278a53d2b7769340ed800142f6662aa48d2 (diff) | |
download | android-node-v8-ae70e2bc34aca8b581f53eb49a27460ac1fc3f83.tar.gz android-node-v8-ae70e2bc34aca8b581f53eb49a27460ac1fc3f83.tar.bz2 android-node-v8-ae70e2bc34aca8b581f53eb49a27460ac1fc3f83.zip |
src: general C++ cleanup in node_url.cc
- Merge `domain` and `opaque` storage in URL parser:
This just simplifies the code a bit, having multiple fields
in an union with the same type is usually just overhead.
- Add move variant of `URLHost::ToString()`:
This helps avoid unnecessary string copy operations, especially
since we control the lifetime of `URLHost` objects pretty well.
- Use const refs in node_url.cc where appropriate
- Remove or reduce overly generous `.reserve()` calls:
These would otherwise keep a lot of unused memory lying around.
- Return return values instead of unnecessary pointer arguments
- Use more common/expressive variable names
- Avoid macro use, reduce number of unnecessary JS strings:
There’s no reason for `GET`, `GET_AND_SET` and `UTF8STRING` to be
macros. Also, `GET` would previously create a JS string instance
for each single call, even though the strings it was called
with were compile-time constants.
- Avoid unnecessary JS casts when the type of a value is known
- Avoid (commonly unnecessary) copy for whitespace stripping
PR-URL: https://github.com/nodejs/node/pull/19598
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'tools/doc/addon-verify.js')
0 files changed, 0 insertions, 0 deletions