Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for indexType (0.22 sec)

  1. src/bytes/bytes.go

    func ContainsFunc(b []byte, f func(rune) bool) bool {
    	return IndexFunc(b, f) >= 0
    }
    
    // IndexByte returns the index of the first instance of c in b, or -1 if c is not present in b.
    func IndexByte(b []byte, c byte) int {
    	return bytealg.IndexByte(b, c)
    }
    
    func indexBytePortable(s []byte, c byte) int {
    	for i, b := range s {
    		if b == c {
    			return i
    		}
    	}
    	return -1
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  2. src/bytes/boundary_test.go

    		Equal(b[len(b)-i:], b[:i])
    	}
    }
    
    func TestIndexByteNearPageBoundary(t *testing.T) {
    	t.Parallel()
    	b := dangerousSlice(t)
    	for i := range b {
    		idx := IndexByte(b[i:], 1)
    		if idx != -1 {
    			t.Fatalf("IndexByte(b[%d:])=%d, want -1\n", i, idx)
    		}
    	}
    }
    
    func TestIndexNearPageBoundary(t *testing.T) {
    	t.Parallel()
    	q := dangerousSlice(t)
    	if len(q) > 64 {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Nov 30 20:05:58 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  3. src/bytes/bytes_test.go

    			b1[j] = 'x'
    			pos := IndexByte(b1, 'x')
    			if pos != j {
    				t.Errorf("IndexByte(%q, 'x') = %v", b1, pos)
    			}
    			b1[j] = 0
    			pos = IndexByte(b1, 'x')
    			if pos != -1 {
    				t.Errorf("IndexByte(%q, 'x') = %v", b1, pos)
    			}
    		}
    		// different end alignments
    		b1 = b[:i]
    		for j := 0; j < len(b1); j++ {
    			b1[j] = 'x'
    			pos := IndexByte(b1, 'x')
    			if pos != j {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  4. cmd/os-dirent_namelen_linux.go

    	limit := dirent.Reclen - fixedHdr
    	if limit > nameBufLen {
    		limit = nameBufLen
    	}
    	// Avoid bugs in long file names
    	// https://github.com/golang/tools/commit/5f9a5413737ba4b4f692214aebee582b47c8be74
    	nameLen := bytes.IndexByte(nameBuf[:limit], 0)
    	if nameLen < 0 {
    		return 0, fmt.Errorf("failed to find terminating 0 byte in dirent")
    	}
    	return uint64(nameLen), nil
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Aug 19 01:35:22 GMT 2021
    - 1.5K bytes
    - Viewed (0)
  5. istioctl/pkg/multixds/google.go

    	}
    	const projSeg = "/projects/"
    	i := strings.Index(u.Path, projSeg)
    	if i == -1 {
    		return nil, fmt.Errorf("webhook URL %s doesn't contain the projects segment", u)
    	}
    	i += len(projSeg)
    	j := strings.IndexByte(u.Path[i:], '/')
    	if j == -1 {
    		return nil, fmt.Errorf("webhook URL %s is malformed", u)
    	}
    	ret.gcpProject = u.Path[i : i+j]
    
    	const crSeg = "/ISTIO_META_CLOUDRUN_ADDR/"
    	i += j
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Mon Jun 06 03:39:27 GMT 2022
    - 1.5K bytes
    - Viewed (1)
  6. cmd/streaming-v4-unsigned.go

    	input := bufio.NewScanner(bytes.NewReader(valueBuffer.Bytes()))
    	for input.Scan() {
    		line := strings.TrimSpace(input.Text())
    		if line == "" {
    			continue
    		}
    		// Find first separator.
    		idx := strings.IndexByte(line, trailerKVSeparator[0])
    		if idx <= 0 || idx >= len(line) {
    			if cr.debug {
    				fmt.Printf("Could not find separator, got %q\n", line)
    			}
    			return errMalformedEncoding
    		}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat May 06 02:53:12 GMT 2023
    - 6.1K bytes
    - Viewed (1)
  7. internal/jwt/parser.go

    func ParseUnverifiedStandardClaims(token []byte, claims *StandardClaims, buf []byte) (*SigningMethodHMAC, error) {
    	if bytes.Count(token, []byte(".")) != 2 {
    		return nil, jwtgo.ErrSignatureInvalid
    	}
    
    	i := bytes.IndexByte(token, '.')
    	j := bytes.LastIndexByte(token, '.')
    
    	n, err := base64DecodeBytes(token[:i], buf)
    	if err != nil {
    		return nil, &jwtgo.ValidationError{Inner: err, Errors: jwtgo.ValidationErrorMalformed}
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue May 09 07:53:08 GMT 2023
    - 13.9K bytes
    - Viewed (0)
  8. src/bufio/example_test.go

    // list with an empty final value but stops at the token "STOP".
    func ExampleScanner_earlyStop() {
    	onComma := func(data []byte, atEOF bool) (advance int, token []byte, err error) {
    		i := bytes.IndexByte(data, ',')
    		if i == -1 {
    			if !atEOF {
    				return 0, nil, nil
    			}
    			// If we have reached the end, return the last token.
    			return 0, data, bufio.ErrFinalToken
    		}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  9. src/bytes/example_test.go

    	fmt.Println(bytes.Index([]byte("chicken"), []byte("dmr")))
    	// Output:
    	// 4
    	// -1
    }
    
    func ExampleIndexByte() {
    	fmt.Println(bytes.IndexByte([]byte("chicken"), byte('k')))
    	fmt.Println(bytes.IndexByte([]byte("chicken"), byte('g')))
    	// Output:
    	// 4
    	// -1
    }
    
    func ExampleIndexFunc() {
    	f := func(c rune) bool {
    		return unicode.Is(unicode.Han, c)
    	}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  10. cmd/metacache-walk.go

    		forward := ""
    		if len(opts.ForwardTo) > 0 && strings.HasPrefix(opts.ForwardTo, current) {
    			forward = strings.TrimPrefix(opts.ForwardTo, current)
    			// Trim further directories and trailing slash.
    			if idx := strings.IndexByte(forward, '/'); idx > 0 {
    				forward = forward[:idx]
    			}
    		}
    		if contextCanceled(ctx) {
    			return ctx.Err()
    		}
    		if opts.Limit > 0 && objsReturned >= opts.Limit {
    			return nil
    		}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 12.4K bytes
    - Viewed (0)
Back to top