| 64 | } |
| 65 | |
| 66 | void ScopeIndices(const TArray<int32>& InIndices, TArray<uint64>& OutScopes) |
| 67 | { |
| 68 | TArray<int32> InIndicesCopy = InIndices; |
| 69 | InIndicesCopy.Sort(); |
| 70 | |
| 71 | int32 StartIndex = InIndicesCopy[0]; |
| 72 | int32 LastIndex = StartIndex; |
| 73 | int32 Count = 1; |
| 74 | |
| 75 | for (int i = 1; i < InIndicesCopy.Num(); i++) |
| 76 | { |
| 77 | const int32 NextIndex = InIndicesCopy[i]; |
| 78 | if (NextIndex == (LastIndex + 1)) |
| 79 | { |
| 80 | Count++; |
| 81 | LastIndex = NextIndex; |
| 82 | continue; |
| 83 | } |
| 84 | |
| 85 | OutScopes.Emplace(H64(StartIndex, Count)); |
| 86 | LastIndex = StartIndex = NextIndex; |
| 87 | Count = 0; |
| 88 | } |
| 89 | |
| 90 | OutScopes.Emplace(H64(StartIndex, Count)); |
| 91 | } |
| 92 | } |