Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7f7e5f

Browse files
PatrickMcDonaldKevinRansom
authored andcommitted
FX_NO_ARRAY_KEY_SORT was not used outside of portable builds (#3200)
1 parentad68b1b commite7f7e5f

File tree

1 file changed

+0
-72
lines changed

1 file changed

+0
-72
lines changed

‎src/fsharp/FSharp.Core/local.fs‎

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -925,81 +925,9 @@ module internal List =
925925
moduleinternalArray=
926926

927927
openSystem
928-
openSystem.Collections.Generic
929-
930-
#if FX_NO_ARRAY_KEY_SORT
931-
// Mimic behavior of BCL QSort routine, used under the hood by various array sorting APIs
932-
letqsort<'Key,'Value>(keys:'Key[],values:'Value[],start:int,last:int,comparer:IComparer<'Key>)=
933-
letvaluesExist=
934-
match valueswith
935-
|null->false
936-
|_->true
937-
938-
letswap(p1,p2)=
939-
lettk= keys.[p1]
940-
keys.[p1]<- keys.[p2]
941-
keys.[p2]<- tk
942-
if valuesExistthen
943-
lettv= values.[p1]
944-
values.[p1]<- values.[p2]
945-
values.[p2]<- tv
946-
947-
letpartition(left,right,pivot)=
948-
letvalue= keys.[pivot]
949-
swap(pivot, right)
950-
let mutablestore= left
951-
952-
for iin left..(right-1)do
953-
if comparer.Compare(keys.[i],value)<0then
954-
swap(i, store)
955-
store<- store+1
956-
957-
swap(store, right)
958-
store
959-
960-
let recqs(left,right)=
961-
if left< rightthen
962-
letpivot= left+(right-left)/2
963-
letnewpivot= partition(left,right,pivot)
964-
qs(left,newpivot-1)
965-
qs(newpivot+1,right)
966-
967-
qs(start, last)
968-
969-
typeSystem.Arraywith
970-
static memberSort<'Key,'Value>(keys:'Key[],values:'Value[],comparer:IComparer<'Key>)=
971-
letvaluesExist=
972-
match valueswith
973-
|null->false
974-
|_->true
975-
match keys,valueswith
976-
|null,_-> raise(ArgumentNullException())
977-
|_,_when valuesExist&&(keys.Length<> values.Length)-> raise(ArgumentException())
978-
|_,_-> qsort(keys, values,0, keys.Length-1, comparer)
979-
980-
static memberSort<'Key,'Valuewhen'Key:comparison>(keys:'Key[],values:'Value[])=
981-
letvaluesExist=
982-
match valueswith
983-
|null->false
984-
|_->true
985-
match keys,valueswith
986-
|null,_-> raise(ArgumentNullException())
987-
|_,_when valuesExist&&(keys.Length<> values.Length)-> raise(ArgumentException())
988-
|_,_-> qsort(keys,values,0,keys.Length-1,LanguagePrimitives.FastGenericComparer<'Key>)
989-
990-
static memberSort<'Key,'Value>(keys:'Key[],values:'Value[],start:int,length:int,comparer:IComparer<'Key>)=
991-
match keyswith
992-
|null-> raise(ArgumentNullException())
993-
|_-> qsort(keys,values,start,start+length-1,comparer)
994-
#else
995-
#endif
996928

997929
let inlinefastComparerForArraySort<'twhen't:comparison>()=
998-
#if FX_NO_ARRAY_KEY_SORT
999-
LanguagePrimitives.FastGenericComparer<'t>
1000-
#else
1001930
LanguagePrimitives.FastGenericComparerCanBeNull<'t>
1002-
#endif
1003931

1004932
// The input parameter should be checked by callers if necessary
1005933
let inlinezeroCreateUnchecked(count:int)=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp