Commit e13b8a3 1 parent 8ee69dc commit e13b8a3 Copy full SHA for e13b8a3
File tree 1 file changed +4
-8
lines changed
packages/block-editor/src/components/global-styles
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -105,14 +105,10 @@ function useHasTextColumnsControl( settings ) {
105
105
106
106
function getUniqueFontSizesBySlug ( settings ) {
107
107
const fontSizes = settings ?. typography ?. fontSizes ;
108
- const mergedFontSizes = fontSizes ? mergeOrigins ( fontSizes ) : [ ] ;
109
- const uniqueSizes = [ ] ;
110
- for ( const currentSize of mergedFontSizes ) {
111
- if ( ! uniqueSizes . some ( ( { slug } ) => slug === currentSize . slug ) ) {
112
- uniqueSizes . push ( currentSize ) ;
113
- }
114
- }
115
- return uniqueSizes ;
108
+ const mergedFontSizes = fontSizes
109
+ ? mergeOrigins ( fontSizes ) . toReversed ( ) // New array because mergeOrigins result is cached.
110
+ : [ ] ;
111
+ return uniqByProperty ( mergedFontSizes , 'slug' ) . reverse ( ) ; // In-place reverse to save memory.
116
112
}
117
113
118
114
/**
You can’t perform that action at this time.
0 commit comments