Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for IndexString (0.2 sec)

  1. src/internal/stringslite/strings.go

    		// Use brute force when s and substr both are small
    		if len(s) <= bytealg.MaxBruteForce {
    			return bytealg.IndexString(s, substr)
    		}
    		c0 := substr[0]
    		c1 := substr[1]
    		i := 0
    		t := len(s) - n + 1
    		fails := 0
    		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 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 04 01:23:42 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  2. src/internal/bytealg/index_native.go

    // Requires 2 <= len(b) <= MaxLen.
    //
    //go:noescape
    func Index(a, b []byte) int
    
    // IndexString returns the index of the first instance of b in a, or -1 if b is not present in a.
    // Requires 2 <= len(b) <= MaxLen.
    //
    //go:noescape
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 02 22:56:35 UTC 2023
    - 590 bytes
    - Viewed (0)
  3. src/internal/bytealg/index_generic.go

    // Requires 2 <= len(b) <= MaxLen.
    func Index(a, b []byte) int {
    	panic("unimplemented")
    }
    
    // IndexString returns the index of the first instance of b in a, or -1 if b is not present in a.
    // Requires 2 <= len(b) <= MaxLen.
    func IndexString(a, b string) int {
    	panic("unimplemented")
    }
    
    // Cutover reports the number of failures of IndexByte we should tolerate
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 901 bytes
    - Viewed (0)
  4. test/codegen/spectre.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package codegen
    
    func IndexArray(x *[10]int, i int) int {
    	// amd64:`CMOVQCC`
    	return x[i]
    }
    
    func IndexString(x string, i int) byte {
    	// amd64:`CMOVQ(LS|CC)`
    	return x[i]
    }
    
    func IndexSlice(x []float64, i int) float64 {
    	// amd64:`CMOVQ(LS|CC)`
    	return x[i]
    }
    
    func SliceArray(x *[10]int, i, j int) []int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 734 bytes
    - Viewed (0)
  5. src/internal/bytealg/index_arm64.s

    #include "textflag.h"
    
    TEXT ·Index(SB),NOSPLIT,$0-56
    	MOVD	a_base+0(FP), R0
    	MOVD	a_len+8(FP), R1
    	MOVD	b_base+24(FP), R2
    	MOVD	b_len+32(FP), R3
    	MOVD	$ret+48(FP), R9
    	B	indexbody<>(SB)
    
    TEXT ·IndexString(SB),NOSPLIT,$0-40
    	MOVD	a_base+0(FP), R0
    	MOVD	a_len+8(FP), R1
    	MOVD	b_base+16(FP), R2
    	MOVD	b_len+24(FP), R3
    	MOVD	$ret+32(FP), R9
    	B	indexbody<>(SB)
    
    // input:
    //   R0: haystack
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 23 15:54:07 UTC 2018
    - 3.9K bytes
    - Viewed (0)
  6. src/internal/bytealg/index_s390x.s

    	LMG	b_base+24(FP), R3, R4 // R3=&sep[0], R4=len(sep)
    	MOVD	$ret+48(FP), R5
    	BR	indexbody<>(SB)
    
    // Caller must confirm availability of vx facility before calling.
    TEXT ·IndexString(SB),NOSPLIT|NOFRAME,$0-40
    	LMG	a_base+0(FP), R1, R2  // R1=&s[0],   R2=len(s)
    	LMG	b_base+16(FP), R3, R4 // R3=&sep[0], R4=len(sep)
    	MOVD	$ret+32(FP), R5
    	BR	indexbody<>(SB)
    
    // s: string we are searching
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Mar 04 19:49:44 UTC 2018
    - 5.5K bytes
    - Viewed (0)
  7. src/internal/bytealg/index_amd64.s

    #include "textflag.h"
    
    TEXT ·Index(SB),NOSPLIT,$0-56
    	MOVQ a_base+0(FP), DI
    	MOVQ a_len+8(FP), DX
    	MOVQ b_base+24(FP), R8
    	MOVQ b_len+32(FP), AX
    	MOVQ DI, R10
    	LEAQ ret+48(FP), R11
    	JMP  indexbody<>(SB)
    
    TEXT ·IndexString(SB),NOSPLIT,$0-40
    	MOVQ a_base+0(FP), DI
    	MOVQ a_len+8(FP), DX
    	MOVQ b_base+16(FP), R8
    	MOVQ b_len+24(FP), AX
    	MOVQ DI, R10
    	LEAQ ret+32(FP), R11
    	JMP  indexbody<>(SB)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:20:48 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  8. src/runtime/os_plan9.go

    			panicmem()
    		}
    		throw(note)
    	case _SIGINTDIV:
    		panicdivide()
    	case _SIGFLOAT:
    		panicfloat()
    	default:
    		panic(errorString(note))
    	}
    }
    
    // indexNoFloat is bytealg.IndexString but safe to use in a note
    // handler.
    func indexNoFloat(s, t string) int {
    	if len(t) == 0 {
    		return 0
    	}
    	for i := 0; i < len(s); i++ {
    		if s[i] == t[0] && stringslite.HasPrefix(s[i:], t) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 15:41:45 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  9. src/internal/bytealg/index_ppc64x.s

    #ifdef GOARCH_ppc64le
    	MOVBZ internal∕cpu·PPC64+const_offsetPPC64HasPOWER9(SB), R7
    	CMP   R7, $1
    	BNE   power8
    	BR    indexbodyp9<>(SB)
    #endif
    power8:
    	BR indexbody<>(SB)
    
    TEXT ·IndexString<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-40
    	// R3 = string
    	// R4 = length
    	// R5 = separator pointer
    	// R6 = separator length
    
    #ifdef GOARCH_ppc64le
    	MOVBZ internal∕cpu·PPC64+const_offsetPPC64HasPOWER9(SB), R7
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 21 16:47:45 UTC 2023
    - 31.6K bytes
    - Viewed (0)
  10. src/regexp/regexp.go

    	} else {
    		regexp.prefix, regexp.prefixComplete, regexp.prefixEnd = onePassPrefix(prog)
    	}
    	if regexp.prefix != "" {
    		// TODO(rsc): Remove this allocation by adding
    		// IndexString to package bytes.
    		regexp.prefixBytes = []byte(regexp.prefix)
    		regexp.prefixRune, _ = utf8.DecodeRuneInString(regexp.prefix)
    	}
    
    	n := len(prog.Inst)
    	i := 0
    	for matchSize[i] != 0 && matchSize[i] < n {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:50:01 UTC 2024
    - 38.5K bytes
    - Viewed (0)
Back to top