Skip to content

zlib: refactor to use primordial instead of <string>.startsWith - #36718

Closed
rchougule wants to merge 1 commit into
nodejs:masterfrom
rchougule:zlib_string_primordials
Closed

zlib: refactor to use primordial instead of <string>.startsWith#36718
rchougule wants to merge 1 commit into
nodejs:masterfrom
rchougule:zlib_string_primordials

Conversation

@rchougule

@rchougulerchougule commented Jan 1, 2021

Copy link
Copy Markdown
Contributor
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added the zlib Issues and PRs related to the zlib subsystem. label Jan 1, 2021

@LxxyxLxxyx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except one nit.

I suggest the first word of the commit message should be an imperative verb, something like zlib: refactor to use primordials instead of StringPrototypeStartsWith. Refs: #36679 (comment)

@rchougule
rchouguleforce-pushed the zlib_string_primordials branch from fcf85c0 to 0665753CompareJanuary 1, 2021 12:59
@rchougule

Copy link
Copy Markdown
ContributorAuthor

LGTM except one nit.

I suggest the first word of the commit message should be an imperative verb, something like zlib: refactor to use primordials instead of StringPrototypeStartsWith. Refs: #36679 (comment)

Ah yes. My bad. Addressed in 0665753

@rchougulerchougule changed the title zlib: StringPrototypeStartsWith primordial instead of <string>.startsWithzlib: refactor to use primordial instead of <string>.startsWithJan 1, 2021
Comment threadlib/zlib.js
Comment on lines +790 to +792
(key) => (StringPrototypeStartsWith(key, 'BROTLI_PARAM_') ?
constants[key] :
0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I find it easier to read on one line, but you can leave it as is if you prefer.

Suggested change
(key)=>(StringPrototypeStartsWith(key,'BROTLI_PARAM_') ?
constants[key] :
0)
(key)=>
(StringPrototypeStartsWith(key,'BROTLI_PARAM_') ? constants[key] : 0)

@yashLadhayashLadha added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jan 8, 2021
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 9, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@yashLadha

Copy link
Copy Markdown
Contributor

Landed in 7a6af02

yashLadha pushed a commit that referenced this pull request Jan 10, 2021
PR-URL: #36718
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
@rchougule
rchougule deleted the zlib_string_primordials branch January 10, 2021 09:17
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
PR-URL: #36718
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
@danielleadamsdanielleadams mentioned this pull request Jan 12, 2021
targos pushed a commit that referenced this pull request May 25, 2021
PR-URL: #36718
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
targos pushed a commit that referenced this pull request May 30, 2021
PR-URL: #36718
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
PR-URL: #36718
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
@targostargos mentioned this pull request Jun 6, 2021
targos pushed a commit that referenced this pull request Jun 11, 2021
PR-URL: #36718
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.zlibIssues and PRs related to the zlib subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@rchougule@nodejs-github-bot@yashLadha@jasnell@Trott@Lxxyx@aduh95@PoojaDurgad