Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: use regexp instead of str.split().join() #3689

Closed
wants to merge 1 commit into from

Conversation

hellopao
Copy link
Contributor

@hellopao hellopao commented Nov 6, 2015

No description provided.

@Fishrock123 Fishrock123 added the util Issues and PRs related to the built-in util module. label Nov 6, 2015
@Fishrock123
Copy link
Contributor

LGTM, looks like this was ancient code.

@cjihrig
Copy link
Contributor

cjihrig commented Nov 6, 2015

LGTM

1 similar comment
@jasnell
Copy link
Member

jasnell commented Nov 6, 2015

LGTM

str = str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n').substr(2);
str = str.replace(/\n/g,'\n ');
Copy link
Member

Choose a reason for hiding this comment

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

minor linting issue... need to put a space after the comma in param lists. I'll fix that when landing tho.

jasnell pushed a commit that referenced this pull request Nov 6, 2015
PR-URL: #3689
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Nov 6, 2015

Landed in 02a44e0

@jasnell jasnell closed this Nov 6, 2015
rvagg pushed a commit that referenced this pull request Nov 7, 2015
PR-URL: #3689
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@Fishrock123 Fishrock123 mentioned this pull request Nov 11, 2015
MylesBorins pushed a commit that referenced this pull request Nov 17, 2015
PR-URL: #3689
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins
Copy link
Contributor

landed in v4.x-staging in 1064eb6

rvagg pushed a commit that referenced this pull request Dec 4, 2015
PR-URL: #3689
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell jasnell mentioned this pull request Dec 17, 2015
jasnell pushed a commit that referenced this pull request Dec 17, 2015
PR-URL: #3689
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell pushed a commit that referenced this pull request Dec 23, 2015
PR-URL: #3689
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants