| ... | ... | @@ -269,14 +269,7 @@ pub const Utf8Iterator = struct { |
| 269 | 269 | |
| 270 | 270 | pub fn nextCodepoint(it: *Utf8Iterator) ?u21 { |
| 271 | 271 | const slice = it.nextCodepointSlice() orelse return null; |
| 272 | | |
| 273 | | switch (slice.len) { |
| 274 | | 1 => return @as(u21, slice[0]), |
| 275 | | 2 => return utf8Decode2(slice) catch unreachable, |
| 276 | | 3 => return utf8Decode3(slice) catch unreachable, |
| 277 | | 4 => return utf8Decode4(slice) catch unreachable, |
| 278 | | else => unreachable, |
| 279 | | } |
| 272 | return utf8Decode(slice) catch unreachable; |
| 280 | 273 | } |
| 281 | 274 | |
| 282 | 275 | /// Look ahead at the next n codepoints without advancing the iterator. |