src,url: separate some tables out of node_url.cc#38988
src,url: separate some tables out of node_url.cc#38988XadillaX wants to merge 5 commits intonodejs:masterfrom
Conversation
The purpose of separating is for readability and maintainability.
src/node_url.h
Outdated
| }; | ||
|
|
||
| namespace table_data { | ||
| extern const char* hex[256]; |
There was a problem hiding this comment.
| extern const char* hex[256]; | |
| extern const char* const hex[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 :)
|
As an alternative to a new *.cc file, these could be moved into a |
Because it's real data, not only declaration. If |
Should we add a TODO comment to move the variables to |
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. |
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
|
Landed in 38a15d8 |
The purpose of separating is for readability and maintainability. PR-URL: nodejs#38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
The purpose of separating is for readability and maintainability. PR-URL: #38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
The purpose of separating is for readability and maintainability. PR-URL: nodejs#38988 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>

The purpose of separating is for readability and maintainability.