• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neon-sunset / U8String / 5868414274

pending completion
5868414274

push

github

neon-sunset
feat: consolidate CopyTo/ToArray/List logic, naming and Rune methods

105 of 704 branches covered (14.91%)

Branch coverage included in aggregate %.

46 of 46 new or added lines in 6 files covered. (100.0%)

372 of 1547 relevant lines covered (24.05%)

460.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/U8String.Splitting.cs
1
using System.Collections;
2
using System.Runtime.InteropServices;
3
using System.Text;
4
using U8Primitives.Abstractions;
5
using U8Primitives.InteropServices;
6

7
#pragma warning disable RCS1085, RCS1085FadeOut, IDE0032 // Use auto-implemented property. Why: readable fields.
8
namespace U8Primitives;
9

10
public readonly partial struct U8String
11
{
12
    public U8SplitPair SplitFirst(byte separator)
13
    {
14
        if (!U8Info.IsAsciiByte(separator))
×
15
        {
16
            // TODO: EH UX
17
            ThrowHelpers.ArgumentOutOfRange();
×
18
        }
19

20
        var source = this;
×
21
        if (!source.IsEmpty)
×
22
        {
23
            var span = source.UnsafeSpan;
×
24
            var index = span.IndexOf(separator);
×
25
            if (index >= 0)
×
26
            {
27
                return new(source, index, 1);
×
28
            }
29

30
            return U8SplitPair.NotFound(source);
×
31
        }
32

33
        return default;
×
34
    }
35

36
    public U8SplitPair SplitFirst(char separator) => char.IsAscii(separator)
×
37
        ? SplitFirst((byte)separator)
×
38
        : SplitFirstUnchecked(separator.NonAsciiToUtf8(out _));
×
39

40
    public U8SplitPair SplitFirst(Rune separator) => separator.IsAscii
×
41
        ? SplitFirst((byte)separator.Value)
×
42
        : SplitFirstUnchecked(separator.NonAsciiToUtf8(out _));
×
43

44
    public U8SplitPair SplitFirst(U8String separator)
45
    {
46
        var source = this;
×
47
        if (!source.IsEmpty)
×
48
        {
49
            if (!separator.IsEmpty)
×
50
            {
51
                var span = source.UnsafeSpan;
×
52
                var index = span.IndexOf(separator.UnsafeSpan);
×
53
                if (index >= 0)
×
54
                {
55
                    return new(source, index, separator.Length);
×
56
                }
57
            }
58

59
            return U8SplitPair.NotFound(source);
×
60
        }
61

62
        return default;
×
63
    }
64

65
    // It would be *really nice* to aggressively inline this method
66
    // but the way validation is currently implemented does not significantly
67
    // benefit from splitting on UTF-8 literals while possibly risking
68
    // running out of inlining budget significantly regressing performance everywhere else.
69
    public U8SplitPair SplitFirst(ReadOnlySpan<byte> separator)
70
    {
71
        var source = this;
×
72
        if (!source.IsEmpty)
×
73
        {
74
            if (!separator.IsEmpty)
×
75
            {
76
                var span = source.UnsafeSpan;
×
77
                var index = span.IndexOf(separator);
×
78
                if (index >= 0)
×
79
                {
80
                    // Same as with Slice(int, int), this might dereference past the end of the string.
81
                    // TODO: Do something about it if it's ever an issue.
82
                    if (U8Info.IsContinuationByte(source.UnsafeRefAdd(index)) ||
×
83
                        U8Info.IsContinuationByte(source.UnsafeRefAdd(index + separator.Length)))
×
84
                    {
85
                        ThrowHelpers.InvalidSplit();
×
86
                    }
87

88
                    return new(source, index, separator.Length);
×
89
                }
90
            }
91

92
            return U8SplitPair.NotFound(source);
×
93
        }
94

95
        return default;
×
96
    }
97

98
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
99
    public U8SplitPair SplitFirstUnchecked(ReadOnlySpan<byte> separator)
100
    {
101
        var source = this;
×
102
        if (!source.IsEmpty)
×
103
        {
104
            if (!separator.IsEmpty)
×
105
            {
106
                var span = source.UnsafeSpan;
×
107
                var index = span.IndexOf(separator);
×
108
                if (index >= 0)
×
109
                {
110
                    return new(source, index, separator.Length);
×
111
                }
112
            }
113

114
            return U8SplitPair.NotFound(source);
×
115
        }
116

117
        return default;
×
118
    }
119

120
    public U8SplitPair SplitLast(byte separator)
121
    {
122
        if (!U8Info.IsAsciiByte(separator))
×
123
        {
124
            // TODO: EH UX
125
            ThrowHelpers.ArgumentOutOfRange();
×
126
        }
127

128
        var source = this;
×
129
        if (!source.IsEmpty)
×
130
        {
131
            var span = source.UnsafeSpan;
×
132
            var index = span.LastIndexOf(separator);
×
133
            if (index >= 0)
×
134
            {
135
                return new(source, index, 1);
×
136
            }
137

138
            return U8SplitPair.NotFound(source);
×
139
        }
140

141
        return default;
×
142
    }
143

144
    public U8SplitPair SplitLast(char separator) => char.IsAscii(separator)
×
145
        ? SplitLast((byte)separator)
×
146
        : SplitLastUnchecked(separator.NonAsciiToUtf8(out _));
×
147

148
    public U8SplitPair SplitLast(Rune separator) => separator.IsAscii
×
149
        ? SplitLast((byte)separator.Value)
×
150
        : SplitLastUnchecked(separator.NonAsciiToUtf8(out _));
×
151

152
    public U8SplitPair SplitLast(U8String separator)
153
    {
154
        var source = this;
×
155
        if (!source.IsEmpty)
×
156
        {
157
            if (!separator.IsEmpty)
×
158
            {
159
                var span = source.UnsafeSpan;
×
160
                var index = span.LastIndexOf(separator.UnsafeSpan);
×
161
                if (index >= 0)
×
162
                {
163
                    return new(source, index, separator.Length);
×
164
                }
165
            }
166

167
            return U8SplitPair.NotFound(source);
×
168
        }
169

170
        return default;
×
171
    }
172

173
    public U8SplitPair SplitLast(ReadOnlySpan<byte> separator)
174
    {
175
        var source = this;
×
176
        if (!source.IsEmpty)
×
177
        {
178
            if (!separator.IsEmpty)
×
179
            {
180
                var span = source.UnsafeSpan;
×
181
                var index = span.LastIndexOf(separator);
×
182
                if (index >= 0)
×
183
                {
184
                    if (U8Info.IsContinuationByte(source.UnsafeRefAdd(index)) ||
×
185
                        U8Info.IsContinuationByte(source.UnsafeRefAdd(index + separator.Length)))
×
186
                    {
187
                        ThrowHelpers.InvalidSplit();
×
188
                    }
189

190
                    return new(source, index, separator.Length);
×
191
                }
192
            }
193

194
            return U8SplitPair.NotFound(source);
×
195
        }
196

197
        return default;
×
198
    }
199

200
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
201
    public U8SplitPair SplitLastUnchecked(ReadOnlySpan<byte> separator)
202
    {
203
        var source = this;
×
204
        if (!source.IsEmpty)
×
205
        {
206
            if (!separator.IsEmpty)
×
207
            {
208
                var span = source.UnsafeSpan;
×
209
                var index = span.LastIndexOf(separator);
×
210
                if (index >= 0)
×
211
                {
212
                    return new(source, index, separator.Length);
×
213
                }
214
            }
215

216
            return U8SplitPair.NotFound(source);
×
217
        }
218

219
        return default;
×
220
    }
221

222
    public U8Split<byte> Split(byte separator)
223
    {
224
        if (!U8Info.IsAsciiByte(separator))
×
225
        {
226
            ThrowHelpers.ArgumentOutOfRange();
×
227
        }
228

229
        return new(this, separator);
×
230
    }
231

232
    public ConfiguredU8Split<byte> Split(byte separator, U8SplitOptions options)
233
    {
234
        if (!U8Info.IsAsciiByte(separator))
×
235
        {
236
            ThrowHelpers.ArgumentOutOfRange();
×
237
        }
238

239
        return new(this, separator, options);
×
240
    }
241

242
    public U8Split<char> Split(char separator)
243
    {
244
        if (char.IsSurrogate(separator))
×
245
        {
246
            ThrowHelpers.ArgumentOutOfRange();
×
247
        }
248

249
        return new(this, separator);
×
250
    }
251

252
    public ConfiguredU8Split<char> Split(char separator, U8SplitOptions options)
253
    {
254
        if (char.IsSurrogate(separator))
×
255
        {
256
            ThrowHelpers.ArgumentOutOfRange();
×
257
        }
258

259
        return new(this, separator, options);
×
260
    }
261

262
    public U8Split<Rune> Split(Rune separator) => new(this, separator);
×
263

264
    public ConfiguredU8Split<Rune> Split(Rune separator, U8SplitOptions options) => new(this, separator, options);
×
265

266
    public U8Split Split(U8String separator)
267
    {
268
        return !separator.IsEmpty ? new(this, separator) : default;
×
269
    }
270

271
    public ConfiguredU8Split<U8String> Split(U8String separator, U8SplitOptions options)
272
    {
273
        return !separator.IsEmpty ? new(this, separator, options) : default;
×
274
    }
275

276
    public U8Split<byte[]> Split(byte[] separator)
277
    {
278
        if (!IsValid(separator))
×
279
        {
280
            // TODO: EH UX
281
            ThrowHelpers.InvalidSplit();
×
282
        }
283

284
        var source = this;
×
285
        return (!source.IsEmpty && separator != null) ? new(source, separator) : default;
×
286
    }
287

288
    public ConfiguredU8Split<byte[]> Split(byte[] separator, U8SplitOptions options)
289
    {
290
        if (!IsValid(separator))
×
291
        {
292
            // TODO: EH UX
293
            ThrowHelpers.InvalidSplit();
×
294
        }
295

296
        var source = this;
×
297
        return (!source.IsEmpty && separator != null) ? new(source, separator, options) : default;
×
298
    }
299
}
300

301
public readonly record struct U8SplitPair
302
{
303
    readonly U8String _value;
304
    readonly int _offset;
305
    readonly int _stride;
306

307
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
308
    internal U8SplitPair(U8String value, int offset, int stride)
309
    {
310
        _value = value;
×
311
        _offset = offset;
×
312
        _stride = stride;
×
313
    }
×
314

315
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
316
    public static U8SplitPair NotFound(U8String value)
317
    {
318
        return new(value, value.Length, 0);
×
319
    }
320

321
    public U8String Segment
322
    {
323
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
324
        get => U8Marshal.Slice(_value, 0, _offset);
×
325
    }
326

327
    public U8String Remainder
328
    {
329
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
330
        get => U8Marshal.Slice(_value, _offset + _stride);
×
331
    }
332

333
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
334
    public void Deconstruct(out U8String segment, out U8String remainder)
335
    {
336
        segment = Segment;
×
337
        remainder = Remainder;
×
338
    }
×
339

340
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
341
    public static implicit operator (U8String, U8String)(U8SplitPair value)
342
    {
343
        return (value.Segment, value.Remainder);
×
344
    }
345
}
346

347
[StructLayout(LayoutKind.Auto)]
348
public struct U8Split :
349
    ICollection<U8String>,
350
    IU8Enumerable<U8Split.Enumerator>
351
{
352
    readonly U8String _value;
353
    readonly U8String _separator;
354
    int _count;
355

356
    internal U8Split(U8String value, U8String separator)
357
    {
358
        if (!value.IsEmpty)
×
359
        {
360
            _value = value;
×
361
            _separator = separator;
×
362
            _count = -1;
×
363
        }
364
    }
×
365

366
    public int Count
367
    {
368
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
369
        get
370
        {
371
            var count = _count;
×
372
            if (count >= 0)
×
373
            {
374
                return count;
×
375
            }
376

377
            // Matches the behavior of string.Split('\n').Length for "hello\n"
378
            // TODO: Should we break consistency and not count the very last segment if it is empty?
379
            return _count = Count(_value.UnsafeSpan, _separator) + 1;
×
380

381
            static int Count(ReadOnlySpan<byte> value, ReadOnlySpan<byte> separator)
382
            {
383
                return U8Searching.Count(value, separator);
×
384
            }
385
        }
386
    }
387

388
    public readonly bool Contains(U8String item)
389
    {
390
        var separator = _separator;
×
391
        var overlaps = U8Searching.Contains(item, separator);
×
392

393
        return !overlaps && _value.Contains(item);
×
394
    }
395

396
    public void CopyTo(U8String[] array, int index)
397
    {
398
        this.CopyTo<U8Split, Enumerator>(array.AsSpan()[index..]);
×
399
    }
×
400

401
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
402
    public readonly void Deconstruct(out U8String first, out U8String second)
403
    {
404
        this.Deconstruct<U8Split, Enumerator>(out first, out second);
×
405
    }
×
406

407
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
408
    public readonly void Deconstruct(out U8String first, out U8String second, out U8String third)
409
    {
410
        this.Deconstruct<U8Split, Enumerator>(out first, out second, out third);
×
411
    }
×
412

413
    public U8String[] ToArray() => this.ToArray<U8Split, Enumerator>();
×
414
    public List<U8String> ToList() => this.ToList<U8Split, Enumerator>();
×
415

416
    /// <summary>
417
    /// Returns a <see cref="Enumerator"/> over the provided string.
418
    /// </summary>
419
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
420
    public readonly Enumerator GetEnumerator() => new(_value, _separator);
×
421

422
    readonly IEnumerator<U8String> IEnumerable<U8String>.GetEnumerator() => GetEnumerator();
×
423
    readonly IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
×
424
    readonly bool ICollection<U8String>.IsReadOnly => true;
×
425

426
    [StructLayout(LayoutKind.Auto)]
427
    public struct Enumerator : IU8Enumerator
428
    {
429
        readonly byte[]? _value;
430
        readonly U8String _separator;
431
        U8Range _current;
432
        U8Range _remaining;
433

434
        internal Enumerator(U8String value, U8String separator)
435
        {
436
            _value = value._value;
×
437
            _separator = separator;
×
438
            _remaining = value._inner;
×
439
        }
×
440

441
        public readonly U8String Current => new(_value, _current.Offset, _current.Length);
×
442

443
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
444
        public bool MoveNext()
445
        {
446
            var remaining = _remaining;
×
447
            if (remaining.Length > 0)
×
448
            {
449
                var value = _value!.SliceUnsafe(remaining.Offset, remaining.Length);
×
450
                var separator = _separator;
×
451
                var index = value.IndexOf(separator.UnsafeSpan);
×
452
                if (index >= 0)
×
453
                {
454
                    _current = new(remaining.Offset, index);
×
455
                    _remaining = new(
×
456
                        remaining.Offset + index + separator.Length,
×
457
                        remaining.Length - index - separator.Length);
×
458
                }
459
                else
460
                {
461
                    _current = remaining;
×
462
                    _remaining = default;
×
463
                }
464

465
                return true;
×
466
            }
467

468
            return false;
×
469
        }
470

471
        readonly object IEnumerator.Current => Current;
×
472
        readonly void IEnumerator.Reset() => throw new NotSupportedException();
×
473
        readonly void IDisposable.Dispose() { }
×
474
    }
475

476
    readonly void ICollection<U8String>.Add(U8String item) => throw new NotSupportedException();
×
477
    readonly void ICollection<U8String>.Clear() => throw new NotSupportedException();
×
478
    readonly bool ICollection<U8String>.Remove(U8String item) => throw new NotSupportedException();
×
479
}
480

481
// TODO: I don't think this is a successful design. JIT/ILC can't optimize away
482
// ASCII char literal conversion causing the size of MoveNext() to explode. This needs an overhaul,
483
// possibly disambiguating on struct vs separator types or maybe even 3 options:
484
// primitive, span (ref split aka SplitRef? SplitSpan?) and U8String / byte[]
485
[StructLayout(LayoutKind.Auto)]
486
public struct U8Split<TSeparator> :
487
    ICollection<U8String>,
488
    IU8Enumerable<U8Split<TSeparator>.Enumerator>
489
{
490
    readonly U8String _value;
491
    readonly TSeparator? _separator;
492
    int _count;
493

494
    // TODO: Move value.IsEmpty -> count = 0 check here
495
    internal U8Split(U8String value, TSeparator? separator)
496
    {
497
        if (!value.IsEmpty)
×
498
        {
499
            _value = value;
×
500
            _separator = separator;
×
501
            _count = -1;
×
502
        }
503
    }
×
504

505
    public int Count
506
    {
507
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
508
        get
509
        {
510
            var count = _count;
×
511
            if (count >= 0)
×
512
            {
513
                return count;
×
514
            }
515

516
            // Matches the behavior of string.Split('\n').Length for "hello\n"
517
            // TODO: Should we break consistency and not count the very last segment if it is empty?
518
            return _count = Count(_value, _separator) + 1;
×
519

520
            static int Count(ReadOnlySpan<byte> value, TSeparator? separator)
521
            {
522
                return U8Searching.Count(value, separator);
×
523
            }
524
        }
525
    }
526

527
    public readonly bool Contains(U8String item)
528
    {
529
        var separator = _separator;
×
530
        var overlaps = U8Searching.Contains(item, separator);
×
531

532
        return !overlaps && _value.Contains(item);
×
533
    }
534

535
    public void CopyTo(U8String[] array, int index)
536
    {
537
        this.CopyTo<U8Split<TSeparator>, Enumerator>(array.AsSpan()[index..]);
×
538
    }
×
539

540
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
541
    public readonly void Deconstruct(out U8String first, out U8String second)
542
    {
543
        this.Deconstruct<U8Split<TSeparator>, Enumerator>(out first, out second);
×
544
    }
×
545

546
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
547
    public readonly void Deconstruct(out U8String first, out U8String second, out U8String third)
548
    {
549
        this.Deconstruct<U8Split<TSeparator>, Enumerator>(out first, out second, out third);
×
550
    }
×
551

552
    public U8String[] ToArray() => this.ToArray<U8Split<TSeparator>, Enumerator>();
×
553
    public List<U8String> ToList() => this.ToList<U8Split<TSeparator>, Enumerator>();
×
554

555
    /// <summary>
556
    /// Returns a <see cref="Enumerator"/> over the provided string.
557
    /// </summary>
558
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
559
    public readonly Enumerator GetEnumerator() => new(_value, _separator);
×
560

561
    readonly IEnumerator<U8String> IEnumerable<U8String>.GetEnumerator() => GetEnumerator();
×
562
    readonly IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
×
563
    readonly bool ICollection<U8String>.IsReadOnly => true;
×
564

565
    [StructLayout(LayoutKind.Auto)]
566
    public struct Enumerator : IU8Enumerator
567
    {
568
        readonly byte[]? _value;
569
        readonly TSeparator? _separator;
570
        readonly U8Size _separatorSize;
571
        U8Range _current;
572
        U8Range _remaining;
573

574
        internal Enumerator(U8String value, TSeparator? separator)
575
        {
576
            _value = value._value;
×
577
            _separator = separator;
×
578
            _separatorSize = U8Info.GetSize(separator);
×
579
            _remaining = value._inner;
×
580
        }
×
581

582
        public readonly U8String Current => new(_value, _current.Offset, _current.Length);
×
583

584
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
585
        public bool MoveNext()
586
        {
587
            var remaining = _remaining;
×
588
            if (remaining.Length > 0)
×
589
            {
590
                var size = _separatorSize;
×
591
                var value = _value!.SliceUnsafe(remaining.Offset, remaining.Length);
×
592
                var index = U8Searching.IndexOf(value, _separator, size);
×
593
                if (index >= 0)
×
594
                {
595
                    _current = new(remaining.Offset, index);
×
596
                    _remaining = new(
×
597
                        remaining.Offset + index + (int)size,
×
598
                        remaining.Length - index - (int)size);
×
599
                }
600
                else
601
                {
602
                    _current = remaining;
×
603
                    _remaining = default;
×
604
                }
605

606
                return true;
×
607
            }
608

609
            return false;
×
610
        }
611

612
        readonly object IEnumerator.Current => Current;
×
613
        readonly void IEnumerator.Reset() => throw new NotSupportedException();
×
614
        readonly void IDisposable.Dispose() { }
×
615
    }
616

617
    readonly void ICollection<U8String>.Add(U8String item) => throw new NotSupportedException();
×
618
    readonly void ICollection<U8String>.Clear() => throw new NotSupportedException();
×
619
    readonly bool ICollection<U8String>.Remove(U8String item) => throw new NotSupportedException();
×
620
}
621

622
public readonly struct ConfiguredU8Split<TSeparator> :
623
    IU8Enumerable<ConfiguredU8Split<TSeparator>.Enumerator>
624
{
625
    readonly U8String _value;
626
    readonly TSeparator? _separator;
627
    readonly U8SplitOptions _options;
628

629
    internal ConfiguredU8Split(U8String value, TSeparator? separator, U8SplitOptions options)
630
    {
631
        _value = value;
×
632
        _separator = separator;
×
633
        _options = options;
×
634
    }
×
635

636
    public readonly Enumerator GetEnumerator() => new(_value, _separator, _options);
×
637

638
    readonly IEnumerator<U8String> IEnumerable<U8String>.GetEnumerator() => GetEnumerator();
×
639
    readonly IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
×
640

641
    public struct Enumerator : IU8Enumerator
642
    {
643
        readonly byte[]? _value;
644
        readonly TSeparator? _separator;
645
        readonly U8Size _separatorSize;
646
        readonly U8SplitOptions _options;
647
        U8Range _current;
648
        U8Range _remaining;
649

650
        internal Enumerator(U8String value, TSeparator? separator, U8SplitOptions options)
651
        {
652
            _value = value._value;
×
653
            _separator = separator;
×
654
            _separatorSize = U8Info.GetSize(separator);
×
655
            _options = options;
×
656
            _remaining = value._inner;
×
657
        }
×
658

659
        public readonly U8String Current => new(_value, _current.Offset, _current.Length);
×
660

661
        // TODO: Not most efficient but it works for now
662
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
663
        public bool MoveNext()
664
        {
665
        Next:
666
            var remaining = _remaining;
×
667
            if (remaining.Length > 0)
×
668
            {
669
                var size = _separatorSize;
×
670
                var value = _value!.SliceUnsafe(remaining.Offset, remaining.Length);
×
671
                var index = U8Searching.IndexOf(value, _separator, size);
×
672
                if (index >= 0)
×
673
                {
674
                    _current = (_options & U8SplitOptions.Trim) != U8SplitOptions.Trim
×
675
                        ? new(remaining.Offset, index)
×
676
                        : TrimEntry(_value!, new(remaining.Offset, index));
×
677
                    _remaining = new(
×
678
                        remaining.Offset + index + (int)size,
×
679
                        remaining.Length - index - (int)size);
×
680
                }
681
                else
682
                {
683
                    _current = (_options & U8SplitOptions.Trim) != U8SplitOptions.Trim
×
684
                        ? remaining
×
685
                        : TrimEntry(_value!, remaining);
×
686
                    _remaining = default;
×
687
                }
688

689
                if ((_options & U8SplitOptions.RemoveEmpty) is U8SplitOptions.RemoveEmpty
×
690
                    && _current.Length is 0)
×
691
                {
692
                    goto Next;
693
                }
694

695
                return true;
×
696
            }
697

698
            return false;
×
699
        }
700

701
        private static U8Range TrimEntry(byte[] value, U8Range range)
702
        {
703
            throw new NotImplementedException();
×
704
        }
705

706
        readonly object IEnumerator.Current => Current;
×
707
        readonly void IEnumerator.Reset() => throw new NotSupportedException();
×
708
        readonly void IDisposable.Dispose() { }
×
709
    }
710
}
711

712
// // TODO:
713
// public ref struct U8RefSplit
714
// {
715
//     readonly U8String _value;
716
//     readonly ReadOnlySpan<byte> _separator;
717
//     // Can't force JIT/ILC to emit proper layout here which is sad, and explicit layout ruins codegen
718
//     // int _count;
719
// }
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc