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

Commitee6b0ee

Browse files
authored
OLD_CAVHE is not set anywhere in the build. (dotnet#2518)
1 parentb946161 commitee6b0ee

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

‎src/utils/prim-parsing.fs‎

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,10 @@ module internal Implementation =
123123
// Read the tables written by FSYACC.
124124

125125
typeAssocTable(elemTab:uint16[],offsetTab:uint16[])=
126-
#if OLD_CACHE
127-
letcache=new Dictionary<int,int>(2000)
128-
#else
129126
letcacheSize=7919// the 1000'th prime
130127
// Use a simpler hash table with faster lookup, but only one
131128
// hash bucket per key.
132129
letcache= Array.zeroCreate<int>(cacheSize*2)
133-
#endif
134130

135131
membert.ReadAssoc(minElemNum,maxElemNum,defaultValueOfAssoc,keyToFind)=
136132
// do a binary chop on the table
@@ -155,29 +151,18 @@ module internal Implementation =
155151
assert(rowNumber<0x10000)
156152
assert(keyToFind<0x10000)
157153
letcacheKey=(rowNumber<<<16)||| keyToFind
158-
#if OLD_CACHE
159-
let mutableres=0
160-
letok= cache.TryGetValue(cacheKey,&res)
161-
if okthen res
162-
else
163-
#else
164-
letcacheIdx= int32(uint32 cacheKey% uint32 cacheSize)
165-
letcacheKey2= cache.[cacheIdx*2]
166-
letv= cache.[cacheIdx*2+1]
154+
letcacheIdx=(int32(uint32 cacheKey% uint32 cacheSize))*2
155+
letcacheKey2= cache.[cacheIdx]
156+
letv= cache.[cacheIdx+1]
167157
if cacheKey= cacheKey2then v
168158
else
169-
#endif
170159
letheadOfTable= int offsetTab.[rowNumber]
171160
letfirstElemNumber= headOfTable+1
172161
letnumberOfElementsInAssoc= int elemTab.[headOfTable*2]
173162
letdefaultValueOfAssoc= int elemTab.[headOfTable*2+1]
174163
letres= t.ReadAssoc(firstElemNumber,firstElemNumber+numberOfElementsInAssoc,defaultValueOfAssoc,keyToFind)
175-
#if OLD_CACHE
176-
cache.[cacheKey]<- res
177-
#else
178-
cache.[cacheIdx*2]<- cacheKey
179-
cache.[cacheIdx*2+1]<- res
180-
#endif
164+
cache.[cacheIdx]<- cacheKey
165+
cache.[cacheIdx+1]<- res
181166
res
182167

183168
// Read all entries in the association table

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp