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

Make unwrapping columns slighly more efficient #45684

Merged
merged 1 commit into from
Nov 10, 2022
Merged

Make unwrapping columns slighly more efficient #45684

merged 1 commit into from
Nov 10, 2022

Conversation

dsas
Copy link
Contributor

@dsas dsas commented Nov 9, 2022

What?

Use flatMap rather than map().flat() when unwrapping columns.

There's no change in behaviour, it's a code quality follow-up from #45666 (comment)

Why?

It's slightly more efficient

How?

As above

Testing Instructions

Exactly as #45666, to whit:

Open a Post or Page
Add a Columns block
Add a whole bunch of content to the different columns
Select the Columns block
Choose 'Unwrap' from the Columns menu
See the Columns block get replaced by the inner contents.

Screenshots or screencast

Use flatMap rather than map().flat();
@dsas dsas requested a review from ajitbohra as a code owner November 9, 2022 23:55
@codesandbox
Copy link

codesandbox bot commented Nov 9, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@talldan talldan added [Type] Code Quality Issues or PRs that relate to code quality [Block] Columns Affects the Columns Block labels Nov 10, 2022
@Mamaduka Mamaduka merged commit 22c2e0a into WordPress:trunk Nov 10, 2022
@github-actions github-actions bot added this to the Gutenberg 14.6 milestone Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Columns Affects the Columns Block [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants