Uh oh!
There was an error while loading. Please reload this page.
src,url: separate some tables out of node_url.cc - #38988
Conversation
The purpose of separating is for readability and maintainability.
| }; | ||
| namespace table_data { | ||
| extern const char* hex[256]; |
There was a problem hiding this comment.
| externconstchar*hex[256]; | |
| externconstchar*consthex[256]; |
(Aside -- using a single string of '%00\0%01\0%02\0...' and then accessing it as hex[index * 4] saves a bit more space and probably improves cache locality a bit.)
There was a problem hiding this comment.
Right – I didn’t say it would increase readability :)
jasnell
commented
Jun 11, 2021
As an alternative to a new *.cc file, these could be moved into a |
XadillaX
commented
Jun 14, 2021
Because it's real data, not only declaration. If |
RaisinTen
commented
Jun 14, 2021
Should we add a TODO comment to move the variables to |
addaleax
commented
Jun 14, 2021
All we’d get out of that is probably just longer compilation times. @XadillaX is right, this is actual data that is accessed as data, so inlining has no benefit here and putting it in a .cc file is just the right thing to do, and I don’t understand why something else would be suggested here. |
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Jun 16, 2021
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
XadillaX
commented
Jun 17, 2021
Landed in 38a15d8 |
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>

The purpose of separating is for readability and maintainability.