Skip to content

Commit df13338

Browse files
authored
Merge pull request #4067 from masatake/dsl--dont-use-hashInthas-for-storing-EsInteger-to-htable
dsl: fix the function for hashing integer object
2 parents e9daadb + 37511df commit df13338

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

Tmain/optscript.d/dict.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ false
2020
1
2121
-dict:1-
2222
null
23+
(---- store integers ----)
24+
45
2325
(---- using types other than name as key objects ----)
2426
(3)
2527
(true)

Tmain/optscript.d/dict.ps

121 Bytes
Binary file not shown.

Tmain/optscript.d/read-and-print.expected

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ efg
2929
-dict:5-
3030
-dict:5-
3131
<<
32-
10 /===
33-
97 1
3432
98 /ab
3533
99 (efg)
3634
100 -dict:4-
35+
10 /===
36+
97 1
3737
>>
3838
<<
39-
10 /====
40-
97 1
4139
98 /ab
4240
99 (efg)
4341
100 <<
@@ -49,20 +47,20 @@ efg
4947
106 /ij
5048
>>
5149
>>
50+
10 /====
51+
97 1
5252
>>
5353
[-dict:6-]
5454
[-dict:6-]
5555
[<<
56-
10 /===
57-
97 1
5856
98 /ab
5957
99 (efg)
6058
100 -dict:4-
59+
10 /===
6160
122 [-dict:2-]
61+
97 1
6262
>> ]
6363
[<<
64-
10 /====
65-
97 1
6664
98 /ab
6765
99 (efg)
6866
100 <<
@@ -78,10 +76,12 @@ efg
7876
>> ]
7977
>>
8078
>>
79+
10 /====
8180
122 [<<
82-
65 1
8381
66 [0 1 2]
82+
65 1
8483
>> ]
84+
97 1
8585
>> ]
8686
char after metachar
8787
[97]

dsl/optscript.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ opt_es_hash (const void * const key)
20642064
const EsObject *k = key;
20652065

20662066
if (es_integer_p (key))
2067-
return hashInthash (key);
2067+
return es_integer_get (key);
20682068
else if (es_boolean_p (key))
20692069
return es_object_equal (key, es_true)? 1: 0;
20702070

0 commit comments

Comments
 (0)