- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 110 for indexByte (0.27 sec)
-
src/internal/stringslite/strings.go
for i < t { if s[i] != c0 { // IndexByte is faster than bytealg.IndexString, so use it as long as // we're not getting lots of false positives. o := IndexByte(s[i+1:t], c0) if o < 0 { return -1 } i += o + 1 } if s[i+1] == c1 && s[i:i+n] == substr { return i } fails++ i++ // Switch to bytealg.IndexString when IndexByte produces too many false positives.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat May 04 01:23:42 UTC 2024 - 2.9K bytes - Viewed (0) -
src/internal/bytealg/indexbyte_generic.go
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Avoid IndexByte and IndexByteString on Plan 9 because it uses // SSE instructions on x86 machines, and those are classified as // floating point instructions, which are illegal in a note handler.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 20 17:30:15 UTC 2023 - 776 bytes - Viewed (0) -
test/fixedbugs/issue24187.go
"unsafe" ) func main() { b := make([]byte, 128) for i := range b { b[i] = 1 } if bytes.IndexByte(b, 0) != -1 { panic("found 0") } for i := range b { b[i] = 0 c := b *(*int)(unsafe.Pointer(uintptr(unsafe.Pointer(&c)) + unsafe.Sizeof(uintptr(0)))) = 1<<31 - 1 if bytes.IndexByte(c, 0) != i { panic(fmt.Sprintf("missing 0 at %d\n", i)) } b[i] = 1 }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:25 UTC 2023 - 604 bytes - Viewed (0) -
src/internal/cpu/cpu.go
continue } *o.Feature = o.Enable } } // indexByte returns the index of the first instance of c in s, // or -1 if c is not present in s. // indexByte is semantically the same as [strings.IndexByte]. // We copy this function because "internal/cpu" should not have external dependencies. func indexByte(s string, c byte) int { for i := 0; i < len(s); i++ { if s[i] == c { return i }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 19:57:43 UTC 2024 - 7.1K bytes - Viewed (0) -
src/internal/bytealg/indexbyte_native.go
//go:build 386 || (amd64 && !plan9) || s390x || arm || arm64 || loong64 || ppc64 || ppc64le || mips || mipsle || mips64 || mips64le || riscv64 || wasm package bytealg //go:noescape func IndexByte(b []byte, c byte) int //go:noescape
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 20 17:30:15 UTC 2023 - 438 bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sys/unix/syscall.go
// ByteSliceFromString returns a NUL-terminated slice of bytes // containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func ByteSliceFromString(s string) ([]byte, error) { if strings.IndexByte(s, 0) != -1 { return nil, EINVAL } a := make([]byte, len(s)+1) copy(a, s) return a, nil } // BytePtrFromString returns a pointer to a NUL-terminated array of
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:33 UTC 2023 - 2.8K bytes - Viewed (0) -
src/cmd/vendor/github.com/google/pprof/profile/legacy_java_profile.go
b = b[nextNewLine+1:] nextNewLine = bytes.IndexByte(b, byte('\n')) } return b, nil } // parseJavaSamples parses the samples from a java profile and // populates the Samples in a profile. Returns the remainder of the // buffer after the samples. func parseJavaSamples(pType string, b []byte, p *Profile) ([]byte, map[uint64]*Location, error) { nextNewLine := bytes.IndexByte(b, byte('\n')) locs := make(map[uint64]*Location)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 16 15:19:53 UTC 2024 - 8.8K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sys/windows/syscall.go
// containing the text of s. If s contains a NUL byte at any // location, it returns (nil, syscall.EINVAL). func ByteSliceFromString(s string) ([]byte, error) { if strings.IndexByte(s, 0) != -1 { return nil, syscall.EINVAL } a := make([]byte, len(s)+1) copy(a, s) return a, nil } // BytePtrFromString returns a pointer to a NUL-terminated array of
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:33 UTC 2023 - 3.2K bytes - Viewed (0) -
src/internal/bytealg/index_ppc64x.go
package bytealg import "internal/cpu" const MaxBruteForce = 16 var SupportsPower9 = cpu.PPC64.IsPOWER9 func init() { MaxLen = 32 } // Cutover reports the number of failures of IndexByte we should tolerate // before switching over to Index. // n is the number of bytes processed so far. // See the bytes.Index implementation for details. func Cutover(n int) int {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 09 05:34:46 UTC 2023 - 637 bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sys/plan9/syscall.go
// ByteSliceFromString returns a NUL-terminated slice of bytes // containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func ByteSliceFromString(s string) ([]byte, error) { if strings.IndexByte(s, 0) != -1 { return nil, EINVAL } a := make([]byte, len(s)+1) copy(a, s) return a, nil } // BytePtrFromString returns a pointer to a NUL-terminated array of
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:33 UTC 2023 - 3.3K bytes - Viewed (0)