@glandais/vcyclist-engine 5.1.1 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,71 +18,78 @@
18
18
  var imul = Math.imul;
19
19
  var hypot = Math.hypot;
20
20
  var VOID = kotlin_kotlin.$_$.a;
21
- var protoOf = kotlin_kotlin.$_$.j7;
22
- var getNumberHashCode = kotlin_kotlin.$_$.q6;
23
- var getBooleanHashCode = kotlin_kotlin.$_$.p6;
24
- var equals = kotlin_kotlin.$_$.n6;
25
- var initMetadataForClass = kotlin_kotlin.$_$.u6;
26
- var numberToLong = kotlin_kotlin.$_$.v5;
27
- var toNumber = kotlin_kotlin.$_$.a6;
28
- var CoroutineImpl = kotlin_kotlin.$_$.d5;
29
- var Unit_instance = kotlin_kotlin.$_$.g1;
30
- var THROW_CCE = kotlin_kotlin.$_$.ca;
31
- var MutableEntry = kotlin_kotlin.$_$.r2;
32
- var isInterface = kotlin_kotlin.$_$.c7;
33
- var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.o4;
34
- var initMetadataForLambda = kotlin_kotlin.$_$.z6;
35
- var constructCallableReference = kotlin_kotlin.$_$.k6;
36
- var emptyList = kotlin_kotlin.$_$.g3;
37
- var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.p1;
38
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.j1;
39
- var toList = kotlin_kotlin.$_$.i4;
40
- var KtList = kotlin_kotlin.$_$.o2;
41
- var initMetadataForCoroutine = kotlin_kotlin.$_$.w6;
42
- var toString = kotlin_kotlin.$_$.m7;
43
- var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.a2;
44
- var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.i1;
45
- var listOf = kotlin_kotlin.$_$.s3;
46
- var numberToInt = kotlin_kotlin.$_$.h7;
47
- var initMetadataForObject = kotlin_kotlin.$_$.a7;
48
- var toList_0 = kotlin_kotlin.$_$.h4;
49
- var collectionSizeOrDefault = kotlin_kotlin.$_$.x2;
50
- var get_indices = kotlin_kotlin.$_$.l3;
51
- var get_lastIndex = kotlin_kotlin.$_$.o3;
52
- var checkBuilderCapacity = kotlin_kotlin.$_$.v2;
53
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.d2;
54
- var coerceIn = kotlin_kotlin.$_$.v7;
55
- var KFunctionImpl = kotlin_kotlin.$_$.a8;
56
- var initMetadataForFunctionReference = kotlin_kotlin.$_$.x6;
57
- var getStringHashCode = kotlin_kotlin.$_$.s6;
58
- var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
59
- var Semaphore = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.f;
60
- var async = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.i;
61
- var awaitAll = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.b;
62
- var coroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.d;
63
- var CompletableDeferred = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.g;
64
- var KtMap = kotlin_kotlin.$_$.p2;
65
- var Mutex = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e;
66
- var contentEquals = kotlin_kotlin.$_$.y2;
67
- var contentHashCode = kotlin_kotlin.$_$.z2;
68
- var objectCreate = kotlin_kotlin.$_$.i7;
69
- var round = kotlin_kotlin.$_$.p7;
70
- var initMetadataForCompanion = kotlin_kotlin.$_$.v6;
71
- var isNaN_0 = kotlin_kotlin.$_$.oa;
72
- var replace = kotlin_kotlin.$_$.z8;
73
- var coerceIn_0 = kotlin_kotlin.$_$.u7;
21
+ var protoOf = kotlin_kotlin.$_$.o7;
22
+ var getNumberHashCode = kotlin_kotlin.$_$.v6;
23
+ var getBooleanHashCode = kotlin_kotlin.$_$.u6;
24
+ var equals = kotlin_kotlin.$_$.s6;
25
+ var initMetadataForClass = kotlin_kotlin.$_$.z6;
26
+ var numberToLong = kotlin_kotlin.$_$.a6;
27
+ var toNumber = kotlin_kotlin.$_$.f6;
28
+ var CoroutineImpl = kotlin_kotlin.$_$.h5;
29
+ var Unit_instance = kotlin_kotlin.$_$.h1;
30
+ var THROW_CCE = kotlin_kotlin.$_$.qa;
31
+ var MutableEntry = kotlin_kotlin.$_$.s2;
32
+ var isInterface = kotlin_kotlin.$_$.h7;
33
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.s4;
34
+ var initMetadataForLambda = kotlin_kotlin.$_$.e7;
35
+ var constructCallableReference = kotlin_kotlin.$_$.p6;
36
+ var emptyList = kotlin_kotlin.$_$.h3;
37
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.q1;
38
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.k1;
39
+ var toList = kotlin_kotlin.$_$.m4;
40
+ var KtList = kotlin_kotlin.$_$.p2;
41
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.b7;
42
+ var toString = kotlin_kotlin.$_$.r7;
43
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.b2;
44
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.j1;
45
+ var listOf = kotlin_kotlin.$_$.u3;
46
+ var numberToInt = kotlin_kotlin.$_$.m7;
47
+ var coerceIn = kotlin_kotlin.$_$.z7;
48
+ var initMetadataForObject = kotlin_kotlin.$_$.f7;
49
+ var toList_0 = kotlin_kotlin.$_$.l4;
50
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.y2;
51
+ var get_indices = kotlin_kotlin.$_$.n3;
52
+ var get_lastIndex = kotlin_kotlin.$_$.q3;
53
+ var checkBuilderCapacity = kotlin_kotlin.$_$.w2;
54
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.e2;
55
+ var coerceIn_0 = kotlin_kotlin.$_$.a8;
56
+ var KFunctionImpl = kotlin_kotlin.$_$.f8;
57
+ var initMetadataForFunctionReference = kotlin_kotlin.$_$.c7;
58
+ var getStringHashCode = kotlin_kotlin.$_$.x6;
59
+ var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
60
+ var Semaphore = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
61
+ var async = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.k;
62
+ var awaitAll = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.c;
63
+ var coroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e;
64
+ var Exception = kotlin_kotlin.$_$.ja;
65
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.y1;
66
+ var captureStack = kotlin_kotlin.$_$.j6;
67
+ var KtMap = kotlin_kotlin.$_$.q2;
68
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.eb;
69
+ var CompletableDeferred = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.i;
70
+ var NonCancellable_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.b;
71
+ var withContext = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.f;
72
+ var CancellationException = kotlin_kotlin.$_$.r4;
73
+ var Mutex = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.g;
74
+ var contentEquals = kotlin_kotlin.$_$.z2;
75
+ var contentHashCode = kotlin_kotlin.$_$.a3;
76
+ var objectCreate = kotlin_kotlin.$_$.n7;
77
+ var round = kotlin_kotlin.$_$.u7;
78
+ var initMetadataForCompanion = kotlin_kotlin.$_$.a7;
79
+ var isNaN_0 = kotlin_kotlin.$_$.cb;
80
+ var replace = kotlin_kotlin.$_$.j9;
74
81
  var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
75
- var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
76
- var joinToString = kotlin_kotlin.$_$.m3;
77
- var sorted = kotlin_kotlin.$_$.c4;
78
- var IllegalStateException_init_$Create$_0 = kotlin_kotlin.$_$.c2;
79
- var setOf = kotlin_kotlin.$_$.a4;
80
- var KProperty0 = kotlin_kotlin.$_$.c8;
81
- var getPropertyCallableRef = kotlin_kotlin.$_$.r6;
82
- var isNumber = kotlin_kotlin.$_$.d7;
83
- var await_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.c;
84
- var charSequenceLength = kotlin_kotlin.$_$.i6;
85
- var lazy = kotlin_kotlin.$_$.pa;
82
+ var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.l;
83
+ var joinToString = kotlin_kotlin.$_$.o3;
84
+ var sorted = kotlin_kotlin.$_$.g4;
85
+ var IllegalStateException_init_$Create$_0 = kotlin_kotlin.$_$.d2;
86
+ var setOf = kotlin_kotlin.$_$.e4;
87
+ var KProperty0 = kotlin_kotlin.$_$.h8;
88
+ var getPropertyCallableRef = kotlin_kotlin.$_$.w6;
89
+ var isNumber = kotlin_kotlin.$_$.i7;
90
+ var await_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.d;
91
+ var charSequenceLength = kotlin_kotlin.$_$.n6;
92
+ var lazy = kotlin_kotlin.$_$.db;
86
93
  //endregion
87
94
  //region block: pre-declaration
88
95
  initMetadataForClass(SmoothingOptions, 'SmoothingOptions', SmoothingOptions);
@@ -110,8 +117,16 @@
110
117
  initMetadataForLambda(Flux$forEachParallel$slambda, CoroutineImpl, VOID, [1]);
111
118
  initMetadataForCoroutine($forEachParallelCOROUTINE$, CoroutineImpl);
112
119
  initMetadataForObject(Flux, 'Flux', VOID, VOID, VOID, [3]);
120
+ initMetadataForClass(Hit, 'Hit');
121
+ initMetadataForClass(Await, 'Await');
122
+ initMetadataForClass(Owner, 'Owner');
123
+ initMetadataForClass(LoadAbandoned, 'LoadAbandoned', LoadAbandoned, Exception);
124
+ initMetadataForLambda(LruCache$load$slambda, CoroutineImpl, VOID, [1]);
125
+ initMetadataForLambda(LruCache$load$slambda_1, CoroutineImpl, VOID, [1]);
113
126
  initMetadataForCoroutine($getCOROUTINE$, CoroutineImpl);
114
- initMetadataForClass(LruCache, 'LruCache', VOID, VOID, VOID, [1, 0]);
127
+ initMetadataForCoroutine($lookupOrClaimCOROUTINE$, CoroutineImpl);
128
+ initMetadataForCoroutine($loadCOROUTINE$, CoroutineImpl);
129
+ initMetadataForClass(LruCache, 'LruCache', VOID, VOID, VOID, [1, 2, 0]);
115
130
  initMetadataForClass(RawTile, 'RawTile');
116
131
  initMetadataForCompanion(Companion);
117
132
  initMetadataForClass(Tile, 'Tile');
@@ -444,21 +459,21 @@
444
459
  if (path.isEmpty_y1axqb_k$())
445
460
  return emptyList();
446
461
  var out = ArrayList_init_$Create$_0(imul(path.get_size_woubt6_k$(), 2));
462
+ var anchor = path.get_c1px32_k$(0);
447
463
  // Inline function 'kotlin.collections.plusAssign' call
448
- var element = path.get_c1px32_k$(0);
464
+ var element = anchor;
449
465
  out.add_utx5q5_k$(element);
450
- var inductionVariable = 0;
451
- var last = path.get_size_woubt6_k$() - 1 | 0;
466
+ var inductionVariable = 1;
467
+ var last = path.get_size_woubt6_k$();
452
468
  if (inductionVariable < last)
453
469
  $l$loop: do {
454
470
  var i = inductionVariable;
455
471
  inductionVariable = inductionVariable + 1 | 0;
456
- var a = path.get_c1px32_k$(i);
457
- var b = path.get_c1px32_k$(i + 1 | 0);
458
- var d = Distance_instance.haversine_mrx4ab_k$(a, b);
472
+ var b = path.get_c1px32_k$(i);
473
+ var d = Distance_instance.haversine_mrx4ab_k$(anchor, b);
459
474
  if (d < minDistance)
460
475
  continue $l$loop;
461
- var between = this.generateCoordinatesBetween_nqn6s8_k$(a, b, step, d);
476
+ var between = this.generateCoordinatesBetween_nqn6s8_k$(anchor, b, step, d);
462
477
  var inductionVariable_0 = 1;
463
478
  var last_0 = between.get_size_woubt6_k$();
464
479
  if (inductionVariable_0 < last_0)
@@ -470,6 +485,7 @@
470
485
  out.add_utx5q5_k$(element_0);
471
486
  }
472
487
  while (inductionVariable_0 < last_0);
488
+ anchor = b;
473
489
  }
474
490
  while (inductionVariable < last);
475
491
  return out;
@@ -589,10 +605,11 @@
589
605
  var tmp_0 = Math.cos(lat1Rad);
590
606
  // Inline function 'kotlin.math.cos' call
591
607
  var a = tmp + tmp_0 * Math.cos(lat2Rad) * sinHalfLon * sinHalfLon;
608
+ var ac = coerceIn(a, 0.0, 1.0);
592
609
  // Inline function 'kotlin.math.sqrt' call
593
- var tmp0 = Math.sqrt(a);
610
+ var tmp0 = Math.sqrt(ac);
594
611
  // Inline function 'kotlin.math.sqrt' call
595
- var x_1 = 1.0 - a;
612
+ var x_1 = 1.0 - ac;
596
613
  // Inline function 'kotlin.math.atan2' call
597
614
  var x_2 = Math.sqrt(x_1);
598
615
  var c = 2.0 * Math.atan2(tmp0, x_2);
@@ -971,8 +988,20 @@
971
988
  tileY = tileY + 1 | 0;
972
989
  }
973
990
  var maxTile = (1 << z) - 1 | 0;
974
- tileX = coerceIn(tileX, 0, maxTile);
975
- tileY = coerceIn(tileY, 0, maxTile);
991
+ if (tileX < 0) {
992
+ tileX = 0;
993
+ x = 0;
994
+ } else if (tileX > maxTile) {
995
+ tileX = maxTile;
996
+ x = tileSize - 1 | 0;
997
+ }
998
+ if (tileY < 0) {
999
+ tileY = 0;
1000
+ y = 0;
1001
+ } else if (tileY > maxTile) {
1002
+ tileY = maxTile;
1003
+ y = tileSize - 1 | 0;
1004
+ }
976
1005
  return new Pixel(new TileCoordinates(tileX, tileY, z), x, y);
977
1006
  };
978
1007
  protoOf(ElevationFunctions).toTileCoordinatesFloat_fctdpc_k$ = function (coords, z) {
@@ -1003,10 +1032,10 @@
1003
1032
  var maxTile = (1 << z) - 1 | 0;
1004
1033
  // Inline function 'kotlin.math.floor' call
1005
1034
  var tmp$ret$9 = Math.floor(xFloat);
1006
- var x_0 = coerceIn(numberToInt(tmp$ret$9), 0, maxTile);
1035
+ var x_0 = coerceIn_0(numberToInt(tmp$ret$9), 0, maxTile);
1007
1036
  // Inline function 'kotlin.math.floor' call
1008
1037
  var tmp$ret$10 = Math.floor(yFloat);
1009
- var y = coerceIn(numberToInt(tmp$ret$10), 0, maxTile);
1038
+ var y = coerceIn_0(numberToInt(tmp$ret$10), 0, maxTile);
1010
1039
  return new TileCoordinatesFloat(x_0, y, xFloat, yFloat, z);
1011
1040
  };
1012
1041
  protoOf(ElevationFunctions).toTileCoordinates_jamtrs_k$ = function (coords, z) {
@@ -1018,11 +1047,11 @@
1018
1047
  // Inline function 'kotlin.math.floor' call
1019
1048
  var x = (tile.xFloat_1 - tile.x_1) * tileSize;
1020
1049
  var tmp$ret$0 = Math.floor(x);
1021
- var px = coerceIn(numberToInt(tmp$ret$0), 0, tileSize - 1 | 0);
1050
+ var px = coerceIn_0(numberToInt(tmp$ret$0), 0, tileSize - 1 | 0);
1022
1051
  // Inline function 'kotlin.math.floor' call
1023
1052
  var x_0 = (tile.yFloat_1 - tile.y_1) * tileSize;
1024
1053
  var tmp$ret$1 = Math.floor(x_0);
1025
- var py = coerceIn(numberToInt(tmp$ret$1), 0, tileSize - 1 | 0);
1054
+ var py = coerceIn_0(numberToInt(tmp$ret$1), 0, tileSize - 1 | 0);
1026
1055
  return new Pixel(new TileCoordinates(tile.x_1, tile.y_1, z), px, py);
1027
1056
  };
1028
1057
  protoOf(ElevationFunctions).toPixelFloat_ler4xt_k$ = function (coords, z, tileSize) {
@@ -1221,19 +1250,49 @@
1221
1250
  while (endIndex < (n - 1 | 0) && distanceM[endIndex + 1 | 0] - current <= windowSize) {
1222
1251
  endIndex = endIndex + 1 | 0;
1223
1252
  }
1253
+ var lowerWindow = current - windowSize;
1254
+ var upperWindow = current + windowSize;
1224
1255
  var totalWeight = 0.0;
1225
1256
  var weightedSum = 0.0;
1226
- var inductionVariable_0 = startIndex;
1227
- var last = endIndex;
1257
+ // Inline function 'kotlin.comparisons.maxOf' call
1258
+ var a = startIndex - 1 | 0;
1259
+ var inductionVariable_0 = Math.max(a, 0);
1260
+ var tmp0 = endIndex;
1261
+ // Inline function 'kotlin.comparisons.minOf' call
1262
+ var b = n - 2 | 0;
1263
+ var last = Math.min(tmp0, b);
1228
1264
  if (inductionVariable_0 <= last)
1229
- do {
1265
+ $l$loop_0: do {
1230
1266
  var j = inductionVariable_0;
1231
1267
  inductionVariable_0 = inductionVariable_0 + 1 | 0;
1268
+ var d0 = distanceM[j];
1269
+ var d1 = distanceM[j + 1 | 0];
1270
+ var length = d1 - d0;
1271
+ if (length <= 0.0)
1272
+ continue $l$loop_0;
1273
+ // Inline function 'kotlin.comparisons.maxOf' call
1274
+ var a_0 = Math.max(d0, lowerWindow);
1275
+ // Inline function 'kotlin.comparisons.minOf' call
1276
+ var b_0 = Math.min(d1, upperWindow);
1277
+ if (b_0 <= a_0)
1278
+ continue $l$loop_0;
1279
+ var e0 = elevationM[j];
1280
+ var slope = (elevationM[j + 1 | 0] - e0) / length;
1281
+ var m = 0.5 * (a_0 + b_0);
1232
1282
  // Inline function 'kotlin.math.absoluteValue' call
1233
- var this_0 = distanceM[j] - current;
1234
- var weight = 1.0 - Math.abs(this_0) / windowSize;
1235
- totalWeight = totalWeight + weight;
1236
- weightedSum = weightedSum + elevationM[j] * weight;
1283
+ var this_0 = a_0 - current;
1284
+ var ka = 1.0 - Math.abs(this_0) / windowSize;
1285
+ // Inline function 'kotlin.math.absoluteValue' call
1286
+ var this_1 = m - current;
1287
+ var km = 1.0 - Math.abs(this_1) / windowSize;
1288
+ // Inline function 'kotlin.math.absoluteValue' call
1289
+ var this_2 = b_0 - current;
1290
+ var kb = 1.0 - Math.abs(this_2) / windowSize;
1291
+ var fa = e0 + slope * (a_0 - d0);
1292
+ var fm = e0 + slope * (m - d0);
1293
+ var fb = e0 + slope * (b_0 - d0);
1294
+ totalWeight = totalWeight + 0.5 * (b_0 - a_0) * (ka + kb);
1295
+ weightedSum = weightedSum + (b_0 - a_0) / 6.0 * (fa * ka + 4.0 * fm * km + fb * kb);
1237
1296
  }
1238
1297
  while (!(j === last));
1239
1298
  out[i] = totalWeight > 0.0 ? weightedSum / totalWeight : elevationM[i];
@@ -1450,6 +1509,199 @@
1450
1509
  function Flux_getInstance() {
1451
1510
  return Flux_instance;
1452
1511
  }
1512
+ function Hit(value) {
1513
+ this.value_1 = value;
1514
+ }
1515
+ function Await(deferred) {
1516
+ this.deferred_1 = deferred;
1517
+ }
1518
+ function Owner(deferred) {
1519
+ this.deferred_1 = deferred;
1520
+ }
1521
+ function LoadAbandoned() {
1522
+ Exception_init_$Init$('load abandoned by its cancelled owner', this);
1523
+ captureStack(this, LoadAbandoned);
1524
+ }
1525
+ function lookupOrClaim($this, key, $completion) {
1526
+ var tmp = new $lookupOrClaimCOROUTINE$($this, key, $completion);
1527
+ tmp.result_1 = Unit_instance;
1528
+ tmp.exception_1 = null;
1529
+ return tmp.doResume_5yljmg_k$();
1530
+ }
1531
+ function load($this, key, ours, $completion) {
1532
+ var tmp = new $loadCOROUTINE$($this, key, ours, $completion);
1533
+ tmp.result_1 = Unit_instance;
1534
+ tmp.exception_1 = null;
1535
+ return tmp.doResume_5yljmg_k$();
1536
+ }
1537
+ function LruCache$load$slambda(this$0, $key, resultContinuation) {
1538
+ this.this$0__1 = this$0;
1539
+ this.$key_1 = $key;
1540
+ CoroutineImpl.call(this, resultContinuation);
1541
+ }
1542
+ protoOf(LruCache$load$slambda).invoke_9w0nwl_k$ = function ($this$withContext, $completion) {
1543
+ var tmp = this.create_rcuf4x_k$($this$withContext, $completion);
1544
+ tmp.result_1 = Unit_instance;
1545
+ tmp.exception_1 = null;
1546
+ return tmp.doResume_5yljmg_k$();
1547
+ };
1548
+ protoOf(LruCache$load$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
1549
+ return this.invoke_9w0nwl_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
1550
+ };
1551
+ protoOf(LruCache$load$slambda).doResume_5yljmg_k$ = function () {
1552
+ var suspendResult = this.result_1;
1553
+ $sm: do
1554
+ try {
1555
+ var tmp = this.state_1;
1556
+ switch (tmp) {
1557
+ case 0:
1558
+ this.exceptionState_1 = 2;
1559
+ this.this1__1 = this.this$0__1.mutex_1;
1560
+ this.owner0__1 = null;
1561
+ this.state_1 = 1;
1562
+ suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
1563
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1564
+ return suspendResult;
1565
+ }
1566
+
1567
+ continue $sm;
1568
+ case 1:
1569
+ var tmp$ret$0 = Unit_instance;
1570
+ l$ret$1: do {
1571
+ var tmp_0;
1572
+ try {
1573
+ tmp$ret$0 = this.this$0__1.inFlight_1.remove_gppy8k_k$(this.$key_1);
1574
+ break l$ret$1;
1575
+ } catch ($p) {
1576
+ var tmp_1;
1577
+ var t = $p;
1578
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
1579
+ throw t;
1580
+ }
1581
+ }
1582
+ while (false);
1583
+ var tmp_2 = tmp$ret$0;
1584
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
1585
+ return tmp_2;
1586
+ case 2:
1587
+ throw this.exception_1;
1588
+ }
1589
+ } catch ($p_0) {
1590
+ var e = $p_0;
1591
+ if (this.exceptionState_1 === 2) {
1592
+ throw e;
1593
+ } else {
1594
+ this.state_1 = this.exceptionState_1;
1595
+ this.exception_1 = e;
1596
+ }
1597
+ }
1598
+ while (true);
1599
+ };
1600
+ protoOf(LruCache$load$slambda).create_rcuf4x_k$ = function ($this$withContext, completion) {
1601
+ var i = new LruCache$load$slambda(this.this$0__1, this.$key_1, completion);
1602
+ i.$this$withContext_1 = $this$withContext;
1603
+ return i;
1604
+ };
1605
+ function LruCache$load$slambda_0(this$0, $key, resultContinuation) {
1606
+ var i = new LruCache$load$slambda(this$0, $key, resultContinuation);
1607
+ return constructCallableReference(function ($this$withContext, $completion) {
1608
+ return i.invoke_9w0nwl_k$($this$withContext, $completion);
1609
+ }, 1);
1610
+ }
1611
+ function LruCache$load$slambda_1(this$0, $key, $value, resultContinuation) {
1612
+ this.this$0__1 = this$0;
1613
+ this.$key_1 = $key;
1614
+ this.$value_1 = $value;
1615
+ CoroutineImpl.call(this, resultContinuation);
1616
+ }
1617
+ protoOf(LruCache$load$slambda_1).invoke_88b81s_k$ = function ($this$withContext, $completion) {
1618
+ var tmp = this.create_rcuf4x_k$($this$withContext, $completion);
1619
+ tmp.result_1 = Unit_instance;
1620
+ tmp.exception_1 = null;
1621
+ return tmp.doResume_5yljmg_k$();
1622
+ };
1623
+ protoOf(LruCache$load$slambda_1).invoke_qns8j1_k$ = function (p1, $completion) {
1624
+ return this.invoke_88b81s_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
1625
+ };
1626
+ protoOf(LruCache$load$slambda_1).doResume_5yljmg_k$ = function () {
1627
+ var suspendResult = this.result_1;
1628
+ $sm: do
1629
+ try {
1630
+ var tmp = this.state_1;
1631
+ switch (tmp) {
1632
+ case 0:
1633
+ this.exceptionState_1 = 2;
1634
+ this.this1__1 = this.this$0__1.mutex_1;
1635
+ this.owner0__1 = null;
1636
+ this.state_1 = 1;
1637
+ suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
1638
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1639
+ return suspendResult;
1640
+ }
1641
+
1642
+ continue $sm;
1643
+ case 1:
1644
+ var tmp$ret$0 = Unit_instance;
1645
+ l$ret$1: do {
1646
+ var tmp_0;
1647
+ try {
1648
+ this.this$0__1.inFlight_1.remove_gppy8k_k$(this.$key_1);
1649
+ var oldest = null;
1650
+ var tmp_1;
1651
+ if (this.this$0__1.entries_1.get_size_woubt6_k$() >= this.this$0__1.maxSize_1) {
1652
+ var tmp0 = this.this$0__1.entries_1;
1653
+ var key = this.$key_1;
1654
+ tmp_1 = !(isInterface(tmp0, KtMap) ? tmp0 : THROW_CCE()).containsKey_aw81wo_k$(key);
1655
+ } else {
1656
+ tmp_1 = false;
1657
+ }
1658
+ if (tmp_1) {
1659
+ var iter = this.this$0__1.entries_1.get_entries_p20ztl_k$().iterator_jk1svi_k$();
1660
+ oldest = iter.next_20eer_k$().get_value_j01efc_k$();
1661
+ iter.remove_ldkf9o_k$();
1662
+ }
1663
+ var tmp0_0 = this.this$0__1.entries_1;
1664
+ var tmp2 = this.$key_1;
1665
+ var value = this.$value_1;
1666
+ tmp0_0.put_4fpzoq_k$(tmp2, value);
1667
+ tmp$ret$0 = oldest;
1668
+ break l$ret$1;
1669
+ } catch ($p) {
1670
+ var tmp_2;
1671
+ var t = $p;
1672
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
1673
+ throw t;
1674
+ }
1675
+ }
1676
+ while (false);
1677
+ var tmp_3 = tmp$ret$0;
1678
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
1679
+ return tmp_3;
1680
+ case 2:
1681
+ throw this.exception_1;
1682
+ }
1683
+ } catch ($p_0) {
1684
+ var e = $p_0;
1685
+ if (this.exceptionState_1 === 2) {
1686
+ throw e;
1687
+ } else {
1688
+ this.state_1 = this.exceptionState_1;
1689
+ this.exception_1 = e;
1690
+ }
1691
+ }
1692
+ while (true);
1693
+ };
1694
+ protoOf(LruCache$load$slambda_1).create_rcuf4x_k$ = function ($this$withContext, completion) {
1695
+ var i = new LruCache$load$slambda_1(this.this$0__1, this.$key_1, this.$value_1, completion);
1696
+ i.$this$withContext_1 = $this$withContext;
1697
+ return i;
1698
+ };
1699
+ function LruCache$load$slambda_2(this$0, $key, $value, resultContinuation) {
1700
+ var i = new LruCache$load$slambda_1(this$0, $key, $value, resultContinuation);
1701
+ return constructCallableReference(function ($this$withContext, $completion) {
1702
+ return i.invoke_88b81s_k$($this$withContext, $completion);
1703
+ }, 1);
1704
+ }
1453
1705
  function $getCOROUTINE$(_this__u8e3s4, key, resultContinuation) {
1454
1706
  CoroutineImpl.call(this, resultContinuation);
1455
1707
  this._this__u8e3s4__1 = _this__u8e3s4;
@@ -1462,155 +1714,201 @@
1462
1714
  var tmp = this.state_1;
1463
1715
  switch (tmp) {
1464
1716
  case 0:
1465
- this.exceptionState_1 = 12;
1466
- this.this11__1 = this._this__u8e3s4__1.mutex_1;
1467
- this.owner10__1 = null;
1717
+ this.exceptionState_1 = 8;
1468
1718
  this.state_1 = 1;
1469
- suspendResult = this.this11__1.lock_ugrcvf_k$(this.owner10__1, this);
1719
+ continue $sm;
1720
+ case 1:
1721
+ if (!true) {
1722
+ this.state_1 = 9;
1723
+ continue $sm;
1724
+ }
1725
+
1726
+ this.state_1 = 2;
1727
+ suspendResult = lookupOrClaim(this._this__u8e3s4__1, this.key_1, this);
1470
1728
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1471
1729
  return suspendResult;
1472
1730
  }
1473
1731
 
1474
1732
  continue $sm;
1475
- case 1:
1476
- var tmp$ret$2 = Unit_instance;
1477
- l$ret$3: do {
1478
- var tmp$ret$0;
1479
- l$ret$1: do {
1480
- var tmp_0;
1481
- try {
1482
- var tmp0_safe_receiver = this._this__u8e3s4__1.entries_1.remove_gppy8k_k$(this.key_1);
1483
- if (tmp0_safe_receiver == null)
1484
- null;
1485
- else {
1486
- var tmp0 = this._this__u8e3s4__1.entries_1;
1487
- var key = this.key_1;
1488
- tmp0.put_4fpzoq_k$(key, tmp0_safe_receiver);
1489
- tmp$ret$0 = tmp0_safe_receiver;
1490
- break l$ret$1;
1733
+ case 2:
1734
+ var lookup = suspendResult;
1735
+ if (lookup instanceof Hit) {
1736
+ return lookup.value_1;
1737
+ } else {
1738
+ if (lookup instanceof Owner) {
1739
+ this.state_1 = 7;
1740
+ suspendResult = load(this._this__u8e3s4__1, this.key_1, lookup.deferred_1, this);
1741
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1742
+ return suspendResult;
1743
+ }
1744
+ continue $sm;
1745
+ } else {
1746
+ if (lookup instanceof Await) {
1747
+ this.exceptionState_1 = 4;
1748
+ this.state_1 = 3;
1749
+ suspendResult = lookup.deferred_1.await_4rdzbx_k$(this);
1750
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1751
+ return suspendResult;
1491
1752
  }
1492
- tmp$ret$2 = this._this__u8e3s4__1.inFlight_1.get_wei43m_k$(this.key_1);
1493
- break l$ret$3;
1494
- } catch ($p) {
1495
- var tmp_1;
1496
- var t = $p;
1497
- this.this11__1.unlock_ulcrcl_k$(this.owner10__1);
1498
- throw t;
1753
+ continue $sm;
1754
+ } else {
1755
+ noWhenBranchMatchedException();
1499
1756
  }
1500
1757
  }
1501
- while (false);
1502
- var tmp_2 = tmp$ret$0;
1503
- this.this11__1.unlock_ulcrcl_k$(this.owner10__1);
1504
- return tmp_2;
1505
1758
  }
1506
- while (false);
1507
- var tmp_3 = tmp$ret$2;
1508
- this.this11__1.unlock_ulcrcl_k$(this.owner10__1);
1509
- var existing = tmp_3;
1510
- if (!(existing == null)) {
1511
- this.state_1 = 11;
1512
- suspendResult = existing.await_4rdzbx_k$(this);
1513
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1514
- return suspendResult;
1515
- }
1759
+
1760
+ break;
1761
+ case 3:
1762
+ return suspendResult;
1763
+ case 4:
1764
+ this.exceptionState_1 = 8;
1765
+ var tmp_0 = this.exception_1;
1766
+ if (tmp_0 instanceof LoadAbandoned) {
1767
+ var _unused_var__etf5q3 = this.exception_1;
1768
+ this.state_1 = 5;
1516
1769
  continue $sm;
1517
1770
  } else {
1518
- this.state_1 = 2;
1519
- continue $sm;
1771
+ throw this.exception_1;
1520
1772
  }
1521
1773
 
1522
- case 2:
1523
- this.ours1__1 = CompletableDeferred();
1524
- this.this9__1 = this._this__u8e3s4__1.mutex_1;
1525
- this.owner8__1 = null;
1526
- this.state_1 = 3;
1527
- suspendResult = this.this9__1.lock_ugrcvf_k$(this.owner8__1, this);
1774
+ case 5:
1775
+ this.exceptionState_1 = 8;
1776
+ this.state_1 = 6;
1777
+ continue $sm;
1778
+ case 6:
1779
+ this.state_1 = 1;
1780
+ continue $sm;
1781
+ case 7:
1782
+ return suspendResult;
1783
+ case 8:
1784
+ throw this.exception_1;
1785
+ case 9:
1786
+ return Unit_instance;
1787
+ }
1788
+ } catch ($p) {
1789
+ var e = $p;
1790
+ if (this.exceptionState_1 === 8) {
1791
+ throw e;
1792
+ } else {
1793
+ this.state_1 = this.exceptionState_1;
1794
+ this.exception_1 = e;
1795
+ }
1796
+ }
1797
+ while (true);
1798
+ };
1799
+ function $lookupOrClaimCOROUTINE$(_this__u8e3s4, key, resultContinuation) {
1800
+ CoroutineImpl.call(this, resultContinuation);
1801
+ this._this__u8e3s4__1 = _this__u8e3s4;
1802
+ this.key_1 = key;
1803
+ }
1804
+ protoOf($lookupOrClaimCOROUTINE$).doResume_5yljmg_k$ = function () {
1805
+ var suspendResult = this.result_1;
1806
+ $sm: do
1807
+ try {
1808
+ var tmp = this.state_1;
1809
+ switch (tmp) {
1810
+ case 0:
1811
+ this.exceptionState_1 = 2;
1812
+ this.this1__1 = this._this__u8e3s4__1.mutex_1;
1813
+ this.owner0__1 = null;
1814
+ this.state_1 = 1;
1815
+ suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
1528
1816
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1529
1817
  return suspendResult;
1530
1818
  }
1531
1819
 
1532
1820
  continue $sm;
1533
- case 3:
1534
- var tmp$ret$6 = Unit_instance;
1535
- l$ret$7: do {
1536
- var tmp$ret$4;
1537
- l$ret$5: do {
1538
- var tmp_4;
1539
- try {
1540
- var tmp0_safe_receiver_0 = this._this__u8e3s4__1.entries_1.remove_gppy8k_k$(this.key_1);
1541
- if (tmp0_safe_receiver_0 == null)
1542
- null;
1543
- else {
1544
- var tmp0_0 = this._this__u8e3s4__1.entries_1;
1545
- var key_0 = this.key_1;
1546
- tmp0_0.put_4fpzoq_k$(key_0, tmp0_safe_receiver_0);
1547
- tmp$ret$4 = tmp0_safe_receiver_0;
1548
- break l$ret$5;
1821
+ case 1:
1822
+ var tmp$ret$2 = Unit_instance;
1823
+ l$ret$3: do {
1824
+ var tmp_0;
1825
+ try {
1826
+ var tmp$ret$0 = Unit_instance;
1827
+ l$ret$1: do {
1828
+ var hit = this._this__u8e3s4__1.entries_1.remove_gppy8k_k$(this.key_1);
1829
+ if (!(hit == null)) {
1830
+ var tmp0 = this._this__u8e3s4__1.entries_1;
1831
+ var key = this.key_1;
1832
+ tmp0.put_4fpzoq_k$(key, hit);
1833
+ tmp$ret$0 = new Hit(hit);
1834
+ break l$ret$1;
1549
1835
  }
1550
1836
  var raced = this._this__u8e3s4__1.inFlight_1.get_wei43m_k$(this.key_1);
1551
- var tmp_5;
1837
+ var tmp_1;
1552
1838
  if (!(raced == null)) {
1553
- tmp_5 = raced;
1839
+ tmp_1 = new Await(raced);
1554
1840
  } else {
1555
- var tmp0_1 = this._this__u8e3s4__1.inFlight_1;
1556
- var tmp2 = this.key_1;
1557
- var value = this.ours1__1;
1558
- tmp0_1.put_4fpzoq_k$(tmp2, value);
1559
- tmp_5 = null;
1841
+ var ours = CompletableDeferred();
1842
+ var tmp0_0 = this._this__u8e3s4__1.inFlight_1;
1843
+ var key_0 = this.key_1;
1844
+ tmp0_0.put_4fpzoq_k$(key_0, ours);
1845
+ tmp_1 = new Owner(ours);
1560
1846
  }
1561
- tmp$ret$6 = tmp_5;
1562
- break l$ret$7;
1563
- } catch ($p_0) {
1564
- var tmp_6;
1565
- var t_0 = $p_0;
1566
- this.this9__1.unlock_ulcrcl_k$(this.owner8__1);
1567
- throw t_0;
1847
+ tmp$ret$0 = tmp_1;
1568
1848
  }
1849
+ while (false);
1850
+ tmp$ret$2 = tmp$ret$0;
1851
+ break l$ret$3;
1852
+ } catch ($p) {
1853
+ var tmp_2;
1854
+ var t = $p;
1855
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
1856
+ throw t;
1569
1857
  }
1570
- while (false);
1571
- var tmp_7 = tmp$ret$4;
1572
- this.this9__1.unlock_ulcrcl_k$(this.owner8__1);
1573
- return tmp_7;
1574
1858
  }
1575
1859
  while (false);
1576
- var tmp_8 = tmp$ret$6;
1577
- this.this9__1.unlock_ulcrcl_k$(this.owner8__1);
1578
- var awaitInstead = tmp_8;
1579
- if (!(awaitInstead == null)) {
1580
- this.state_1 = 10;
1581
- suspendResult = awaitInstead.await_4rdzbx_k$(this);
1582
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1583
- return suspendResult;
1584
- }
1585
- continue $sm;
1586
- } else {
1587
- this.state_1 = 4;
1588
- continue $sm;
1589
- }
1590
-
1591
- case 4:
1860
+ var tmp_3 = tmp$ret$2;
1861
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
1862
+ return tmp_3;
1863
+ case 2:
1864
+ throw this.exception_1;
1865
+ }
1866
+ } catch ($p_0) {
1867
+ var e = $p_0;
1868
+ if (this.exceptionState_1 === 2) {
1869
+ throw e;
1870
+ } else {
1871
+ this.state_1 = this.exceptionState_1;
1872
+ this.exception_1 = e;
1873
+ }
1874
+ }
1875
+ while (true);
1876
+ };
1877
+ function $loadCOROUTINE$(_this__u8e3s4, key, ours, resultContinuation) {
1878
+ CoroutineImpl.call(this, resultContinuation);
1879
+ this._this__u8e3s4__1 = _this__u8e3s4;
1880
+ this.key_1 = key;
1881
+ this.ours_1 = ours;
1882
+ }
1883
+ protoOf($loadCOROUTINE$).doResume_5yljmg_k$ = function () {
1884
+ var suspendResult = this.result_1;
1885
+ $sm: do
1886
+ try {
1887
+ var tmp = this.state_1;
1888
+ switch (tmp) {
1889
+ case 0:
1592
1890
  this.exceptionState_1 = 6;
1593
- this.state_1 = 5;
1891
+ this.exceptionState_1 = 2;
1892
+ this.state_1 = 1;
1594
1893
  suspendResult = this._this__u8e3s4__1.loader_1(this.key_1, this);
1595
1894
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1596
1895
  return suspendResult;
1597
1896
  }
1598
1897
 
1599
1898
  continue $sm;
1600
- case 5:
1601
- this.TRY_RESULT4__1 = suspendResult;
1602
- this.exceptionState_1 = 12;
1603
- this.state_1 = 8;
1899
+ case 1:
1900
+ this.TRY_RESULT1__1 = suspendResult;
1901
+ this.exceptionState_1 = 6;
1902
+ this.state_1 = 4;
1604
1903
  continue $sm;
1605
- case 6:
1606
- this.exceptionState_1 = 12;
1607
- var tmp_9 = this.exception_1;
1608
- if (tmp_9 instanceof Error) {
1609
- this.t5__1 = this.exception_1;
1610
- this.this7__1 = this._this__u8e3s4__1.mutex_1;
1611
- this.owner6__1 = null;
1612
- this.state_1 = 7;
1613
- suspendResult = this.this7__1.lock_ugrcvf_k$(this.owner6__1, this);
1904
+ case 2:
1905
+ this.exceptionState_1 = 6;
1906
+ var tmp_0 = this.exception_1;
1907
+ if (tmp_0 instanceof Error) {
1908
+ this.t2__1 = this.exception_1;
1909
+ this.state_1 = 3;
1910
+ var tmp_1 = NonCancellable_getInstance();
1911
+ suspendResult = withContext(tmp_1, LruCache$load$slambda_0(this._this__u8e3s4__1, this.key_1, null), this);
1614
1912
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1615
1913
  return suspendResult;
1616
1914
  }
@@ -1619,86 +1917,47 @@
1619
1917
  throw this.exception_1;
1620
1918
  }
1621
1919
 
1622
- case 7:
1623
- l$ret$9: do {
1624
- var tmp_10;
1625
- try {
1626
- this._this__u8e3s4__1.inFlight_1.remove_gppy8k_k$(this.key_1);
1627
- break l$ret$9;
1628
- } catch ($p_1) {
1629
- var tmp_11;
1630
- var t_1 = $p_1;
1631
- this.this7__1.unlock_ulcrcl_k$(this.owner6__1);
1632
- throw t_1;
1633
- }
1920
+ case 3:
1921
+ var tmp_2;
1922
+ var tmp_3 = this.t2__1;
1923
+ if (tmp_3 instanceof CancellationException) {
1924
+ tmp_2 = new LoadAbandoned();
1925
+ } else {
1926
+ tmp_2 = this.t2__1;
1634
1927
  }
1635
- while (false);
1636
- this.this7__1.unlock_ulcrcl_k$(this.owner6__1);
1637
- this.ours1__1.completeExceptionally_xyzekf_k$(this.t5__1);
1638
- var tmp_12 = this;
1639
- throw this.t5__1;
1640
- case 8:
1641
- this.exceptionState_1 = 12;
1642
- this.value0__1 = this.TRY_RESULT4__1;
1643
- this.this3__1 = this._this__u8e3s4__1.mutex_1;
1644
- this.owner2__1 = null;
1645
- this.state_1 = 9;
1646
- suspendResult = this.this3__1.lock_ugrcvf_k$(this.owner2__1, this);
1928
+
1929
+ this.ours_1.completeExceptionally_xyzekf_k$(tmp_2);
1930
+ var tmp_4 = this;
1931
+ throw this.t2__1;
1932
+ case 4:
1933
+ this.exceptionState_1 = 6;
1934
+ this.value0__1 = this.TRY_RESULT1__1;
1935
+ this.state_1 = 5;
1936
+ var tmp_5 = NonCancellable_getInstance();
1937
+ suspendResult = withContext(tmp_5, LruCache$load$slambda_2(this._this__u8e3s4__1, this.key_1, this.value0__1, null), this);
1647
1938
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1648
1939
  return suspendResult;
1649
1940
  }
1650
1941
 
1651
1942
  continue $sm;
1652
- case 9:
1653
- l$ret$11: do {
1654
- var tmp_13;
1655
- try {
1656
- this._this__u8e3s4__1.inFlight_1.remove_gppy8k_k$(this.key_1);
1657
- var tmp_14;
1658
- if (this._this__u8e3s4__1.entries_1.get_size_woubt6_k$() >= this._this__u8e3s4__1.maxSize_1) {
1659
- var tmp0_2 = this._this__u8e3s4__1.entries_1;
1660
- var key_1 = this.key_1;
1661
- tmp_14 = !(isInterface(tmp0_2, KtMap) ? tmp0_2 : THROW_CCE()).containsKey_aw81wo_k$(key_1);
1662
- } else {
1663
- tmp_14 = false;
1664
- }
1665
- if (tmp_14) {
1666
- var iter = this._this__u8e3s4__1.entries_1.get_entries_p20ztl_k$().iterator_jk1svi_k$();
1667
- var oldest = iter.next_20eer_k$();
1668
- var oldestValue = oldest.get_value_j01efc_k$();
1669
- iter.remove_ldkf9o_k$();
1670
- var tmp0_safe_receiver_1 = this._this__u8e3s4__1.onEvict_1;
1671
- if (tmp0_safe_receiver_1 == null)
1672
- null;
1673
- else
1674
- tmp0_safe_receiver_1(oldestValue);
1675
- }
1676
- var tmp0_3 = this._this__u8e3s4__1.entries_1;
1677
- var tmp2_0 = this.key_1;
1678
- var value_0 = this.value0__1;
1679
- tmp0_3.put_4fpzoq_k$(tmp2_0, value_0);
1680
- break l$ret$11;
1681
- } catch ($p_2) {
1682
- var tmp_15;
1683
- var t_2 = $p_2;
1684
- this.this3__1.unlock_ulcrcl_k$(this.owner2__1);
1685
- throw t_2;
1686
- }
1943
+ case 5:
1944
+ var evicted = suspendResult;
1945
+ this.ours_1.complete_ixf84q_k$(this.value0__1);
1946
+ if (!(evicted == null)) {
1947
+ var tmp0_safe_receiver = this._this__u8e3s4__1.onEvict_1;
1948
+ if (tmp0_safe_receiver == null)
1949
+ null;
1950
+ else
1951
+ tmp0_safe_receiver(evicted);
1687
1952
  }
1688
- while (false);
1689
- this.this3__1.unlock_ulcrcl_k$(this.owner2__1);
1690
- this.ours1__1.complete_ixf84q_k$(this.value0__1);
1953
+
1691
1954
  return this.value0__1;
1692
- case 10:
1693
- return suspendResult;
1694
- case 11:
1695
- return suspendResult;
1696
- case 12:
1955
+ case 6:
1697
1956
  throw this.exception_1;
1698
1957
  }
1699
- } catch ($p_3) {
1700
- var e = $p_3;
1701
- if (this.exceptionState_1 === 12) {
1958
+ } catch ($p) {
1959
+ var e = $p;
1960
+ if (this.exceptionState_1 === 6) {
1702
1961
  throw e;
1703
1962
  } else {
1704
1963
  this.state_1 = this.exceptionState_1;
@@ -2056,7 +2315,7 @@
2056
2315
  return this.distanceTo_53ug7b_k$(segmentStart);
2057
2316
  var pointVector = this.minus_de4vqf_k$(segmentStart);
2058
2317
  var projection = pointVector.dot_o3y6jk_k$(segmentVector) / segmentLengthSq;
2059
- var clamped = coerceIn_0(projection, 0.0, 1.0);
2318
+ var clamped = coerceIn(projection, 0.0, 1.0);
2060
2319
  var closest = segmentStart.plus_e4szu7_k$(segmentVector.times_qz1dds_k$(clamped));
2061
2320
  return this.distanceTo_53ug7b_k$(closest);
2062
2321
  };