File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33const {
4- ArrayPrototypeSlice,
5- ArrayPrototypeSort,
4+ ArrayPrototypeToSorted,
65 RegExpPrototypeExec,
76 StringFromCharCode,
87 StringPrototypeCharCodeAt,
@@ -385,7 +384,7 @@ function commonPrefix(strings) {
385384 if ( strings . length === 1 ) {
386385 return strings [ 0 ] ;
387386 }
388- const sorted = ArrayPrototypeSort ( ArrayPrototypeSlice ( strings ) ) ;
387+ const sorted = ArrayPrototypeToSorted ( strings ) ;
389388 const min = sorted [ 0 ] ;
390389 const max = sorted [ sorted . length - 1 ] ;
391390 for ( let i = 0 ; i < min . length ; i ++ ) {
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ declare namespace primordials {
128128 export const ArrayPrototypeSlice : UncurryThis < typeof Array . prototype . slice >
129129 export const ArrayPrototypeSort : UncurryThis < typeof Array . prototype . sort >
130130 export const ArrayPrototypeSplice : UncurryThis < typeof Array . prototype . splice >
131+ export const ArrayPrototypeToSorted : UncurryThis < typeof Array . prototype . toSorted >
131132 export const ArrayPrototypeIncludes : UncurryThis < typeof Array . prototype . includes >
132133 export const ArrayPrototypeIndexOf : UncurryThis < typeof Array . prototype . indexOf >
133134 export const ArrayPrototypeJoin : UncurryThis < typeof Array . prototype . join >
You can’t perform that action at this time.
0 commit comments