@@ -5,7 +5,7 @@ import * as Caml_option from "./caml_option.js";
5
5
import * as Belt_internalAVLtree from "./belt_internalAVLtree.js" ;
6
6
7
7
function set ( t , newK , newD , cmp ) {
8
- if ( t === null ) {
8
+ if ( t === undefined ) {
9
9
return Belt_internalAVLtree . singleton ( newK , newD ) ;
10
10
}
11
11
var k = t . key ;
@@ -24,7 +24,7 @@ function set(t, newK, newD, cmp) {
24
24
}
25
25
26
26
function updateU ( t , newK , f , cmp ) {
27
- if ( t !== null ) {
27
+ if ( t !== undefined ) {
28
28
var k = t . key ;
29
29
var c = cmp ( newK , k ) ;
30
30
if ( c === 0 ) {
@@ -34,10 +34,10 @@ function updateU(t, newK, f, cmp) {
34
34
}
35
35
var l = t . left ;
36
36
var r = t . right ;
37
- if ( l === null ) {
37
+ if ( l === undefined ) {
38
38
return r ;
39
39
}
40
- if ( r === null ) {
40
+ if ( r === undefined ) {
41
41
return l ;
42
42
}
43
43
var kr = {
@@ -85,10 +85,10 @@ function removeAux0(n, x, cmp) {
85
85
var r = n . right ;
86
86
var c = cmp ( x , v ) ;
87
87
if ( c === 0 ) {
88
- if ( l === null ) {
88
+ if ( l === undefined ) {
89
89
return r ;
90
90
}
91
- if ( r === null ) {
91
+ if ( r === undefined ) {
92
92
return l ;
93
93
}
94
94
var kr = {
@@ -101,7 +101,7 @@ function removeAux0(n, x, cmp) {
101
101
return Belt_internalAVLtree . bal ( l , kr . contents , vr . contents , r$1 ) ;
102
102
}
103
103
if ( c < 0 ) {
104
- if ( l === null ) {
104
+ if ( l === undefined ) {
105
105
return n ;
106
106
}
107
107
var ll = removeAux0 ( l , x , cmp ) ;
@@ -111,7 +111,7 @@ function removeAux0(n, x, cmp) {
111
111
return Belt_internalAVLtree . bal ( ll , v , n . value , r ) ;
112
112
}
113
113
}
114
- if ( r === null ) {
114
+ if ( r === undefined ) {
115
115
return n ;
116
116
}
117
117
var rr = removeAux0 ( r , x , cmp ) ;
@@ -123,11 +123,10 @@ function removeAux0(n, x, cmp) {
123
123
}
124
124
125
125
function remove ( n , x , cmp ) {
126
- if ( n !== null ) {
126
+ if ( n !== undefined ) {
127
127
return removeAux0 ( n , x , cmp ) ;
128
- } else {
129
- return null ;
130
128
}
129
+
131
130
}
132
131
133
132
function mergeMany ( h , arr , cmp ) {
@@ -154,9 +153,9 @@ function splitAuxPivot(n, x, pres, cmp) {
154
153
] ;
155
154
}
156
155
if ( c < 0 ) {
157
- if ( l === null ) {
156
+ if ( l === undefined ) {
158
157
return /* tuple */ [
159
- null ,
158
+ undefined ,
160
159
n
161
160
] ;
162
161
}
@@ -166,10 +165,10 @@ function splitAuxPivot(n, x, pres, cmp) {
166
165
Belt_internalAVLtree . join ( match [ 1 ] , v , d , r )
167
166
] ;
168
167
}
169
- if ( r === null ) {
168
+ if ( r === undefined ) {
170
169
return /* tuple */ [
171
170
n ,
172
- null
171
+ undefined
173
172
] ;
174
173
}
175
174
var match$1 = splitAuxPivot ( r , x , pres , cmp ) ;
@@ -180,11 +179,11 @@ function splitAuxPivot(n, x, pres, cmp) {
180
179
}
181
180
182
181
function split ( n , x , cmp ) {
183
- if ( n === null ) {
182
+ if ( n === undefined ) {
184
183
return /* tuple */ [
185
184
/* tuple */ [
186
- null ,
187
- null
185
+ undefined ,
186
+ undefined
188
187
] ,
189
188
undefined
190
189
] ;
@@ -200,16 +199,16 @@ function split(n, x, cmp) {
200
199
}
201
200
202
201
function mergeU ( s1 , s2 , f , cmp ) {
203
- if ( s1 === null ) {
204
- if ( s2 !== null ) {
202
+ if ( s1 === undefined ) {
203
+ if ( s2 !== undefined ) {
205
204
return Belt_internalAVLtree . keepMapU ( s2 , ( function ( k , v ) {
206
205
return f ( k , undefined , Caml_option . some ( v ) ) ;
207
206
} ) ) ;
208
207
} else {
209
- return null ;
208
+ return ;
210
209
}
211
210
}
212
- if ( s2 === null ) {
211
+ if ( s2 === undefined ) {
213
212
return Belt_internalAVLtree . keepMapU ( s1 , ( function ( k , v ) {
214
213
return f ( k , Caml_option . some ( v ) , undefined ) ;
215
214
} ) ) ;
@@ -250,7 +249,7 @@ function merge(s1, s2, f, cmp) {
250
249
251
250
function removeMany ( t , keys , cmp ) {
252
251
var len = keys . length ;
253
- if ( t !== null ) {
252
+ if ( t !== undefined ) {
254
253
var _t = t ;
255
254
var _i = 0 ;
256
255
while ( true ) {
@@ -261,19 +260,18 @@ function removeMany(t, keys, cmp) {
261
260
}
262
261
var ele = keys [ i ] ;
263
262
var u = removeAux0 ( t$1 , ele , cmp ) ;
264
- if ( u === null ) {
263
+ if ( u === undefined ) {
265
264
return u ;
266
265
}
267
266
_i = i + 1 | 0 ;
268
267
_t = u ;
269
268
continue ;
270
269
} ;
271
- } else {
272
- return null ;
273
270
}
271
+
274
272
}
275
273
276
- var empty = null ;
274
+ var empty ;
277
275
278
276
var isEmpty = Belt_internalAVLtree . isEmpty ;
279
277
0 commit comments