- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for EncodeRune (0.05 sec)
-
src/bufio/bufio.go
if b.Flush(); b.err != nil { return 0, b.err } n = b.Available() if n < utf8.UTFMax { // Can only happen if buffer is silly small. return b.WriteString(string(r)) } } size = utf8.EncodeRune(b.buf[b.n:], r) b.n += size return size, nil } // WriteString writes a string. // It returns the number of bytes written. // If the count is less than len(s), it also returns an error explaining
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Wed Sep 03 14:04:47 UTC 2025 - 22K bytes - Viewed (0) -
src/bytes/bytes.go
// The distribution of the last byte is more uniform compared to the // first byte which has a 78% chance of being [240, 243, 244]. var b [utf8.UTFMax]byte n := utf8.EncodeRune(b[:], r) last := n - 1 i := last fails := 0 for i < len(s) { if s[i] != b[last] { o := IndexByte(s[i+1:], b[last]) if o < 0 { return -1 } i += o + 1 }
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Wed Sep 03 14:04:47 UTC 2025 - 35.5K bytes - Viewed (0)