| | | 1 | | //======================================================================= |
| | | 2 | | // NavigationSurfaceEdgeEnumerator.cs |
| | | 3 | | //======================================================================= |
| | | 4 | | // MIT License, Copyright (c) 2024-present David Oravsky (mrdav30) |
| | | 5 | | // See LICENSE file in the project root for full license information. |
| | | 6 | | //======================================================================= |
| | | 7 | | |
| | | 8 | | namespace Trailblazer.Pathing; |
| | | 9 | | |
| | | 10 | | internal enum NavigationSurfaceEdgeAdvanceStatus : byte |
| | | 11 | | { |
| | | 12 | | Pending = 0, |
| | | 13 | | Edge = 1, |
| | | 14 | | Complete = 2, |
| | | 15 | | Blocked = 3 |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | /// <summary>Merges native, explicit, and automatic-seam edges in durable canonical order.</summary> |
| | | 19 | | internal struct NavigationSurfaceEdgeEnumerator |
| | | 20 | | { |
| | | 21 | | private readonly NavigationWorldGraph? _graph; |
| | | 22 | | private readonly NavigationCellAddress _origin; |
| | | 23 | | private NavigationPagedSequence<NavigationConnectionOwnerKey>.Enumerator _incident; |
| | | 24 | | private NavigationNativeSurfaceEdgeEnumerator _native; |
| | | 25 | | private NavigationAutomaticSeamIndex.EndpointEnumerator _seam; |
| | | 26 | | private readonly bool _incoming; |
| | | 27 | | private readonly bool _structural; |
| | | 28 | | private bool _nativeComplete; |
| | | 29 | | private bool _explicitComplete; |
| | | 30 | | private bool _seamComplete; |
| | | 31 | | private bool _hasNative; |
| | | 32 | | private bool _hasExplicit; |
| | | 33 | | private bool _hasSeam; |
| | | 34 | | private bool _nativeNeedsDebit; |
| | | 35 | | private bool _hasPendingExplicitOwner; |
| | | 36 | | private bool _hasPendingSeam; |
| | | 37 | | private NavigationConnectionOwnerKey _pendingExplicitOwner; |
| | | 38 | | private NavigationAutomaticSeamRef _pendingSeam; |
| | | 39 | | private NavigationGraphEdge _nativeEdge; |
| | | 40 | | private NavigationGraphEdge _explicitEdge; |
| | | 41 | | private NavigationGraphEdge _seamEdge; |
| | | 42 | | private NavigationCellAddress _nativeEndpoint; |
| | | 43 | | private NavigationCellAddress _explicitEndpoint; |
| | | 44 | | private NavigationCellAddress _seamEndpoint; |
| | | 45 | | private int _currentOrdinal; |
| | | 46 | | |
| | | 47 | | internal NavigationSurfaceEdgeEnumerator( |
| | | 48 | | NavigationWorldGraph graph, |
| | | 49 | | NavigationNodeRef origin, |
| | | 50 | | bool incoming, |
| | | 51 | | bool includeNative, |
| | | 52 | | bool includeAutomaticSeams, |
| | | 53 | | bool structural = false) |
| | | 54 | | { |
| | 521164 | 55 | | _graph = graph; |
| | 521164 | 56 | | _incoming = incoming; |
| | 521164 | 57 | | _structural = structural; |
| | 521164 | 58 | | _nativeComplete = !includeNative; |
| | 521164 | 59 | | _explicitComplete = false; |
| | 521164 | 60 | | _seamComplete = !includeAutomaticSeams; |
| | 521164 | 61 | | _hasNative = false; |
| | 521164 | 62 | | _hasExplicit = false; |
| | 521164 | 63 | | _hasSeam = false; |
| | 521164 | 64 | | _nativeNeedsDebit = false; |
| | 521164 | 65 | | _hasPendingExplicitOwner = false; |
| | 521164 | 66 | | _hasPendingSeam = false; |
| | 521164 | 67 | | _pendingExplicitOwner = default; |
| | 521164 | 68 | | _pendingSeam = default; |
| | 521164 | 69 | | _nativeEdge = default; |
| | 521164 | 70 | | _explicitEdge = default; |
| | 521164 | 71 | | _seamEdge = default; |
| | 521164 | 72 | | _nativeEndpoint = default; |
| | 521164 | 73 | | _explicitEndpoint = default; |
| | 521164 | 74 | | _seamEndpoint = default; |
| | 521164 | 75 | | _currentOrdinal = -1; |
| | 521164 | 76 | | Current = default; |
| | 521164 | 77 | | bool found = graph.TryGetNodeAddress(origin, out _origin); |
| | | 78 | | System.Diagnostics.Debug.Assert(found); |
| | 521164 | 79 | | if (structural |
| | 521164 | 80 | | ? !graph.HasEffectiveCell(_origin) |
| | 521164 | 81 | | : !graph.TryGetNodeState(origin, out NavigationNodeState state) |
| | 521164 | 82 | | || !state.IsPresent) |
| | | 83 | | { |
| | 40 | 84 | | _graph = null; |
| | 40 | 85 | | _origin = default; |
| | 40 | 86 | | _incident = default; |
| | 40 | 87 | | _native = default; |
| | 40 | 88 | | _seam = default; |
| | 40 | 89 | | return; |
| | | 90 | | } |
| | 521124 | 91 | | NavigationPagedSequence<NavigationConnectionOwnerKey> endpoints = |
| | 521124 | 92 | | graph.ExplicitConnections.GetEndpointOwnerRow(_origin); |
| | 521124 | 93 | | _incident = endpoints.GetEnumerator(); |
| | 521124 | 94 | | _seam = includeAutomaticSeams |
| | 521124 | 95 | | ? graph.AutomaticSeams.GetActiveEndpointEnumerator(_origin) |
| | 521124 | 96 | | : default; |
| | 521124 | 97 | | _native = includeNative |
| | 521124 | 98 | | ? structural |
| | 521124 | 99 | | ? graph.EnumerateStructuralNativeSurfaceEdges(origin) |
| | 521124 | 100 | | : graph.EnumerateNativeSurfaceEdges(origin) |
| | 521124 | 101 | | : default; |
| | 521124 | 102 | | } |
| | | 103 | | |
| | | 104 | | internal NavigationGraphEdge Current { get; private set; } |
| | | 105 | | |
| | 313310 | 106 | | internal int CurrentOrdinal => _currentOrdinal; |
| | | 107 | | |
| | | 108 | | internal bool MoveNext() |
| | | 109 | | { |
| | 60577 | 110 | | int unbounded = int.MaxValue; |
| | | 111 | | while (true) |
| | | 112 | | { |
| | 80777 | 113 | | NavigationSurfaceEdgeAdvanceStatus status = AdvanceOne( |
| | 80777 | 114 | | (NavigationWorkMeter?)null, |
| | 80777 | 115 | | ref unbounded); |
| | 80777 | 116 | | if (status == NavigationSurfaceEdgeAdvanceStatus.Edge) |
| | 40355 | 117 | | return true; |
| | 40422 | 118 | | if (status == NavigationSurfaceEdgeAdvanceStatus.Complete) |
| | 20222 | 119 | | return false; |
| | | 120 | | } |
| | | 121 | | } |
| | | 122 | | |
| | | 123 | | internal NavigationSurfaceEdgeAdvanceStatus AdvanceOne( |
| | | 124 | | NavigationWorkMeter? meter, |
| | | 125 | | ref int edgeStepRemaining) |
| | | 126 | | { |
| | 565507 | 127 | | GuideSampleWorkMeter unused = default; |
| | 565507 | 128 | | return AdvanceOneCore( |
| | 565507 | 129 | | meter, |
| | 565507 | 130 | | null, |
| | 565507 | 131 | | ref unused, |
| | 565507 | 132 | | useGuideMeter: false, |
| | 565507 | 133 | | ref edgeStepRemaining); |
| | | 134 | | } |
| | | 135 | | |
| | | 136 | | internal NavigationSurfaceEdgeAdvanceStatus AdvanceOne( |
| | | 137 | | MaintenanceWorkMeter meter, |
| | | 138 | | ref int edgeStepRemaining) |
| | | 139 | | { |
| | 1820660 | 140 | | GuideSampleWorkMeter unused = default; |
| | 1820660 | 141 | | return AdvanceOneCore( |
| | 1820660 | 142 | | null, |
| | 1820660 | 143 | | meter, |
| | 1820660 | 144 | | ref unused, |
| | 1820660 | 145 | | useGuideMeter: false, |
| | 1820660 | 146 | | ref edgeStepRemaining); |
| | | 147 | | } |
| | | 148 | | |
| | | 149 | | internal NavigationSurfaceEdgeAdvanceStatus AdvanceOne( |
| | | 150 | | ref GuideSampleWorkMeter meter, |
| | 5974 | 151 | | ref int edgeStepRemaining) => AdvanceOneCore( |
| | 5974 | 152 | | null, |
| | 5974 | 153 | | null, |
| | 5974 | 154 | | ref meter, |
| | 5974 | 155 | | useGuideMeter: true, |
| | 5974 | 156 | | ref edgeStepRemaining); |
| | | 157 | | |
| | | 158 | | private NavigationSurfaceEdgeAdvanceStatus AdvanceOneCore( |
| | | 159 | | NavigationWorkMeter? queryMeter, |
| | | 160 | | MaintenanceWorkMeter? maintenanceMeter, |
| | | 161 | | ref GuideSampleWorkMeter guideMeter, |
| | | 162 | | bool useGuideMeter, |
| | | 163 | | ref int edgeStepRemaining) |
| | | 164 | | { |
| | 2392141 | 165 | | if (_graph == null) |
| | 40 | 166 | | return NavigationSurfaceEdgeAdvanceStatus.Complete; |
| | | 167 | | |
| | 2392101 | 168 | | if (!_hasNative && !_nativeComplete) |
| | | 169 | | { |
| | 1566713 | 170 | | if (!_nativeNeedsDebit) |
| | | 171 | | { |
| | 1566561 | 172 | | if (maintenanceMeter != null) |
| | | 173 | | { |
| | 1358726 | 174 | | NavigationSurfaceEdgeAdvanceStatus nativeStatus = |
| | 1358726 | 175 | | _native.AdvanceOne(maintenanceMeter, ref edgeStepRemaining); |
| | 1358726 | 176 | | if (nativeStatus == NavigationSurfaceEdgeAdvanceStatus.Blocked) |
| | 211 | 177 | | return nativeStatus; |
| | 1358515 | 178 | | if (nativeStatus == NavigationSurfaceEdgeAdvanceStatus.Pending) |
| | 543314 | 179 | | return nativeStatus; |
| | 815201 | 180 | | if (nativeStatus == NavigationSurfaceEdgeAdvanceStatus.Complete) |
| | 184689 | 181 | | _nativeComplete = true; |
| | | 182 | | else |
| | | 183 | | { |
| | 630512 | 184 | | _nativeEdge = _native.Current; |
| | 630512 | 185 | | _graph.TryGetNodeAddress(_nativeEdge.Target, out _nativeEndpoint); |
| | 630512 | 186 | | _hasNative = true; |
| | 630512 | 187 | | return TrySelectReadyEdge(); |
| | | 188 | | } |
| | | 189 | | } |
| | 207835 | 190 | | else if (!_native.MoveNext()) |
| | | 191 | | { |
| | 129464 | 192 | | _nativeComplete = true; |
| | | 193 | | } |
| | | 194 | | else |
| | | 195 | | { |
| | 78371 | 196 | | _nativeEdge = _native.Current; |
| | 78371 | 197 | | _graph.TryGetNodeAddress(_nativeEdge.Target, out _nativeEndpoint); |
| | 78371 | 198 | | _nativeNeedsDebit = true; |
| | | 199 | | } |
| | | 200 | | } |
| | 392676 | 201 | | if (_nativeNeedsDebit) |
| | | 202 | | { |
| | 78523 | 203 | | if (!TryConsumeCandidate( |
| | 78523 | 204 | | queryMeter, |
| | 78523 | 205 | | maintenanceMeter, |
| | 78523 | 206 | | ref guideMeter, |
| | 78523 | 207 | | useGuideMeter, |
| | 78523 | 208 | | ref edgeStepRemaining)) |
| | 175 | 209 | | return NavigationSurfaceEdgeAdvanceStatus.Blocked; |
| | 78348 | 210 | | _nativeNeedsDebit = false; |
| | 78348 | 211 | | _hasNative = true; |
| | 78348 | 212 | | return TrySelectReadyEdge(); |
| | | 213 | | } |
| | | 214 | | } |
| | | 215 | | |
| | 1139541 | 216 | | if (!_hasExplicit && !_explicitComplete) |
| | | 217 | | { |
| | 685466 | 218 | | if (!_hasPendingExplicitOwner) |
| | | 219 | | { |
| | 685455 | 220 | | if (!_incident.MoveNext()) |
| | 475741 | 221 | | _explicitComplete = true; |
| | | 222 | | else |
| | | 223 | | { |
| | 209714 | 224 | | _pendingExplicitOwner = _incident.Current; |
| | 209714 | 225 | | _hasPendingExplicitOwner = true; |
| | | 226 | | } |
| | | 227 | | } |
| | 685466 | 228 | | if (_hasPendingExplicitOwner) |
| | | 229 | | { |
| | 209725 | 230 | | if (!TryConsumeCandidate( |
| | 209725 | 231 | | queryMeter, |
| | 209725 | 232 | | maintenanceMeter, |
| | 209725 | 233 | | ref guideMeter, |
| | 209725 | 234 | | useGuideMeter, |
| | 209725 | 235 | | ref edgeStepRemaining)) |
| | 11 | 236 | | return NavigationSurfaceEdgeAdvanceStatus.Blocked; |
| | 209714 | 237 | | NavigationConnectionOwnerKey owner = _pendingExplicitOwner; |
| | 209714 | 238 | | _pendingExplicitOwner = default; |
| | 209714 | 239 | | _hasPendingExplicitOwner = false; |
| | 209714 | 240 | | FillExplicit(owner); |
| | 209714 | 241 | | return TrySelectReadyEdge(); |
| | | 242 | | } |
| | | 243 | | } |
| | | 244 | | |
| | 929816 | 245 | | if (!_hasSeam && !_seamComplete) |
| | | 246 | | { |
| | 643083 | 247 | | if (!_hasPendingSeam) |
| | | 248 | | { |
| | 643082 | 249 | | if (!_seam.MoveNext()) |
| | 440105 | 250 | | _seamComplete = true; |
| | | 251 | | else |
| | | 252 | | { |
| | 202977 | 253 | | _pendingSeam = _seam.Current; |
| | 202977 | 254 | | _hasPendingSeam = true; |
| | | 255 | | } |
| | | 256 | | } |
| | 643083 | 257 | | if (_hasPendingSeam) |
| | | 258 | | { |
| | 202978 | 259 | | if (!TryConsumeCandidate( |
| | 202978 | 260 | | queryMeter, |
| | 202978 | 261 | | maintenanceMeter, |
| | 202978 | 262 | | ref guideMeter, |
| | 202978 | 263 | | useGuideMeter, |
| | 202978 | 264 | | ref edgeStepRemaining)) |
| | 1 | 265 | | return NavigationSurfaceEdgeAdvanceStatus.Blocked; |
| | 202977 | 266 | | NavigationAutomaticSeamRef seam = _pendingSeam; |
| | 202977 | 267 | | _pendingSeam = default; |
| | 202977 | 268 | | _hasPendingSeam = false; |
| | 202977 | 269 | | FillSeam(seam); |
| | 202977 | 270 | | return TrySelectReadyEdge(); |
| | | 271 | | } |
| | | 272 | | } |
| | | 273 | | |
| | 726838 | 274 | | return TrySelectReadyEdge(); |
| | | 275 | | } |
| | | 276 | | |
| | | 277 | | private NavigationSurfaceEdgeAdvanceStatus TrySelectReadyEdge() |
| | | 278 | | { |
| | 1848389 | 279 | | if (!IsSelectionReady( |
| | 1848389 | 280 | | _hasNative, |
| | 1848389 | 281 | | _nativeComplete, |
| | 1848389 | 282 | | _hasExplicit, |
| | 1848389 | 283 | | _explicitComplete, |
| | 1848389 | 284 | | _hasSeam, |
| | 1848389 | 285 | | _seamComplete)) |
| | | 286 | | { |
| | 581688 | 287 | | return NavigationSurfaceEdgeAdvanceStatus.Pending; |
| | | 288 | | } |
| | 1266701 | 289 | | if (!_hasNative && !_hasExplicit && !_hasSeam) |
| | | 290 | | { |
| | 224647 | 291 | | Current = default; |
| | 224647 | 292 | | return NavigationSurfaceEdgeAdvanceStatus.Complete; |
| | | 293 | | } |
| | 1042054 | 294 | | NavigationGraphEdge selected = default; |
| | 1042054 | 295 | | NavigationCellAddress selectedEndpoint = default; |
| | 1042054 | 296 | | int selectedKind = -1; |
| | 1042054 | 297 | | if (_hasNative) |
| | | 298 | | { |
| | 777615 | 299 | | selected = _nativeEdge; |
| | 777615 | 300 | | selectedEndpoint = _nativeEndpoint; |
| | 777615 | 301 | | selectedKind = 0; |
| | | 302 | | } |
| | 1042054 | 303 | | if (_hasExplicit |
| | 1042054 | 304 | | && (selectedKind < 0 |
| | 1042054 | 305 | | || Compare( |
| | 1042054 | 306 | | _explicitEdge, |
| | 1042054 | 307 | | _explicitEndpoint, |
| | 1042054 | 308 | | selected, |
| | 1042054 | 309 | | selectedEndpoint) < 0)) |
| | | 310 | | { |
| | 190660 | 311 | | selected = _explicitEdge; |
| | 190660 | 312 | | selectedEndpoint = _explicitEndpoint; |
| | 190660 | 313 | | selectedKind = 1; |
| | | 314 | | } |
| | 1042054 | 315 | | if (_hasSeam |
| | 1042054 | 316 | | && (selectedKind < 0 |
| | 1042054 | 317 | | || Compare( |
| | 1042054 | 318 | | _seamEdge, |
| | 1042054 | 319 | | _seamEndpoint, |
| | 1042054 | 320 | | selected, |
| | 1042054 | 321 | | selectedEndpoint) < 0)) |
| | | 322 | | { |
| | 182786 | 323 | | selected = _seamEdge; |
| | 182786 | 324 | | selectedKind = 2; |
| | | 325 | | } |
| | 1042054 | 326 | | Current = selected; |
| | 1042054 | 327 | | _currentOrdinal++; |
| | 1042054 | 328 | | if (selectedKind == 0) |
| | 708773 | 329 | | _hasNative = false; |
| | 333281 | 330 | | else if (selectedKind == 1) |
| | 150495 | 331 | | _hasExplicit = false; |
| | | 332 | | else |
| | 182786 | 333 | | _hasSeam = false; |
| | 1042054 | 334 | | return NavigationSurfaceEdgeAdvanceStatus.Edge; |
| | | 335 | | } |
| | | 336 | | |
| | | 337 | | internal static bool IsSelectionReady( |
| | | 338 | | bool hasNative, |
| | | 339 | | bool nativeComplete, |
| | | 340 | | bool hasExplicit, |
| | | 341 | | bool explicitComplete, |
| | | 342 | | bool hasSeam, |
| | 1848395 | 343 | | bool seamComplete) => (hasNative || nativeComplete) |
| | 1848395 | 344 | | && (hasExplicit || explicitComplete) |
| | 1848395 | 345 | | && (hasSeam || seamComplete); |
| | | 346 | | |
| | | 347 | | private void FillExplicit(NavigationConnectionOwnerKey owner) |
| | | 348 | | { |
| | 209714 | 349 | | if (!_graph!.ExplicitConnections.TryGet( |
| | 209714 | 350 | | owner, |
| | 209714 | 351 | | out NavigationExplicitConnectionRecord record) |
| | 209714 | 352 | | || !record.IsActive) |
| | | 353 | | { |
| | 213 | 354 | | return; |
| | | 355 | | } |
| | | 356 | | NavigationCellAddress endpoint; |
| | 209501 | 357 | | if (_incoming) |
| | | 358 | | { |
| | 37315 | 359 | | if (!record.Destination.Equals(_origin)) |
| | 8651 | 360 | | return; |
| | 28664 | 361 | | endpoint = record.Source; |
| | | 362 | | } |
| | | 363 | | else |
| | | 364 | | { |
| | 172186 | 365 | | if (!record.Source.Equals(_origin)) |
| | 33764 | 366 | | return; |
| | 138422 | 367 | | endpoint = record.Destination; |
| | | 368 | | } |
| | 167086 | 369 | | bool found = _graph.TryGetNodeRef(endpoint, out NavigationNodeRef target); |
| | | 370 | | System.Diagnostics.Debug.Assert(found, |
| | | 371 | | "Active explicit endpoints belong to published graph nodes."); |
| | 167086 | 372 | | _explicitEndpoint = endpoint; |
| | 167086 | 373 | | _explicitEdge = new NavigationGraphEdge(target, record); |
| | 167086 | 374 | | _hasExplicit = true; |
| | 167086 | 375 | | } |
| | | 376 | | |
| | | 377 | | private void FillSeam(NavigationAutomaticSeamRef seam) |
| | | 378 | | { |
| | 202977 | 379 | | NavigationCellAddress endpoint = seam.Destination; |
| | 202977 | 380 | | bool found = _graph!.TryGetNodeRef(endpoint, out NavigationNodeRef target); |
| | | 381 | | System.Diagnostics.Debug.Assert(found, |
| | | 382 | | "Active automatic-seam rows reference published graph nodes."); |
| | 202977 | 383 | | bool hasEffectiveCell = false; |
| | 202977 | 384 | | bool hasNodeState = false; |
| | 202977 | 385 | | NavigationNodeState state = default; |
| | 202977 | 386 | | if (_structural) |
| | 2819 | 387 | | hasEffectiveCell = _graph.HasEffectiveCell(endpoint); |
| | | 388 | | else |
| | 200158 | 389 | | hasNodeState = _graph.TryGetNodeState(target, out state); |
| | 202977 | 390 | | if (!IsSeamEndpointEligible( |
| | 202977 | 391 | | _structural, |
| | 202977 | 392 | | hasEffectiveCell, |
| | 202977 | 393 | | hasNodeState, |
| | 202977 | 394 | | state.IsPresent)) |
| | | 395 | | { |
| | 8 | 396 | | return; |
| | | 397 | | } |
| | 202969 | 398 | | _seamEndpoint = endpoint; |
| | 202969 | 399 | | _seamEdge = new NavigationGraphEdge(target, seam); |
| | 202969 | 400 | | _hasSeam = true; |
| | 202969 | 401 | | } |
| | | 402 | | |
| | | 403 | | internal static bool IsSeamEndpointEligible( |
| | | 404 | | bool structural, |
| | | 405 | | bool hasEffectiveCell, |
| | | 406 | | bool hasNodeState, |
| | 202982 | 407 | | bool isPresent) => structural |
| | 202982 | 408 | | ? hasEffectiveCell |
| | 202982 | 409 | | : hasNodeState && isPresent; |
| | | 410 | | |
| | | 411 | | internal static bool TryConsumeCandidate( |
| | | 412 | | NavigationWorkMeter? queryMeter, |
| | | 413 | | MaintenanceWorkMeter? maintenanceMeter, |
| | | 414 | | ref GuideSampleWorkMeter guideMeter, |
| | | 415 | | bool useGuideMeter, |
| | | 416 | | ref int edgeStepRemaining) |
| | | 417 | | { |
| | 491234 | 418 | | if (queryMeter == null && maintenanceMeter == null && !useGuideMeter) |
| | 360433 | 419 | | return true; |
| | 130801 | 420 | | if (edgeStepRemaining == 0 |
| | 130801 | 421 | | || (queryMeter != null && !queryMeter.TryConsumeEvaluatedEdges(1)) |
| | 130801 | 422 | | || (maintenanceMeter != null |
| | 130801 | 423 | | && !maintenanceMeter.TryConsumeSurfaceComponentEdges(1)) |
| | 130801 | 424 | | || (useGuideMeter && !guideMeter.TryConsumeCursorLegScans(1))) |
| | | 425 | | { |
| | 191 | 426 | | return false; |
| | | 427 | | } |
| | 130610 | 428 | | edgeStepRemaining--; |
| | 130610 | 429 | | return true; |
| | | 430 | | } |
| | | 431 | | |
| | | 432 | | private static int Compare( |
| | | 433 | | in NavigationGraphEdge left, |
| | | 434 | | NavigationCellAddress leftEndpoint, |
| | | 435 | | in NavigationGraphEdge right, |
| | | 436 | | NavigationCellAddress rightEndpoint) |
| | | 437 | | { |
| | 316326 | 438 | | int comparison = leftEndpoint.CompareTo(rightEndpoint); |
| | 316326 | 439 | | if (comparison != 0) |
| | 162698 | 440 | | return comparison; |
| | 153628 | 441 | | comparison = (int)left.Kind - (int)right.Kind; |
| | 153628 | 442 | | return comparison; |
| | | 443 | | } |
| | | 444 | | } |