Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 110 for indexByte (0.17 sec)

  1. src/internal/bytealg/indexbyte_loong64.s

    // Copyright 2022 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.
    
    #include "go_asm.h"
    #include "textflag.h"
    
    TEXT ·IndexByte<ABIInternal>(SB),NOSPLIT,$0-40
    	// R4 = b_base
    	// R5 = b_len
    	// R6 = b_cap (unused)
    	// R7 = byte to find
    	AND	$0xff, R7
    	MOVV	R4, R6		// store base for later
    	ADDV	R4, R5		// end
    	ADDV	$-1, R4
    
    	PCALIGN	$16
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 15:04:25 UTC 2024
    - 905 bytes
    - Viewed (0)
  2. 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 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 56.5K bytes
    - Viewed (0)
  3. src/internal/bytealg/indexbyte_riscv64.s

    // Copyright 2019 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.
    
    #include "go_asm.h"
    #include "textflag.h"
    
    TEXT ·IndexByte<ABIInternal>(SB),NOSPLIT,$0-40
    	// X10 = b_base
    	// X11 = b_len
    	// X12 = b_cap (unused)
    	// X13 = byte to find
    	AND	$0xff, X13
    	MOV	X10, X12		// store base for later
    	ADD	X10, X11		// end
    	SUB	$1, X10
    
    loop:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 09 13:57:06 UTC 2023
    - 919 bytes
    - Viewed (0)
  4. operator/pkg/validate/common.go

    	}
    	if !strings.Contains(pn, "[") && !strings.Contains(pn, "]") {
    		return false
    	}
    	indexPattern := pattern[strings.IndexByte(pattern, '[')+1 : strings.IndexByte(pattern, ']')]
    	if indexPattern == "*" {
    		return true
    	}
    	index := pn[strings.IndexByte(pn, '[')+1 : strings.IndexByte(pn, ']')]
    	return indexPattern == index
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Aug 10 15:35:03 UTC 2023
    - 11K bytes
    - Viewed (0)
  5. src/cmd/go/internal/telemetrystats/version_unix.go

    import (
    	"bytes"
    	"fmt"
    	"runtime"
    	"strings"
    
    	"cmd/internal/telemetry"
    
    	"golang.org/x/sys/unix"
    )
    
    func incrementVersionCounters() {
    	convert := func(nullterm []byte) string {
    		end := bytes.IndexByte(nullterm, 0)
    		if end < 0 {
    			end = len(nullterm)
    		}
    		return string(nullterm[:end])
    	}
    
    	var v unix.Utsname
    	err := unix.Uname(&v)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 15:44:55 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  6. src/strings/example_test.go

    	fmt.Println(strings.IndexAny("crwth", "aeiouy"))
    	// Output:
    	// 2
    	// -1
    }
    
    func ExampleIndexByte() {
    	fmt.Println(strings.IndexByte("golang", 'g'))
    	fmt.Println(strings.IndexByte("gophers", 'h'))
    	fmt.Println(strings.IndexByte("golang", 'x'))
    	// Output:
    	// 0
    	// 3
    	// -1
    }
    func ExampleIndexRune() {
    	fmt.Println(strings.IndexRune("chicken", 'k'))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 22:05:38 UTC 2023
    - 10.7K bytes
    - Viewed (0)
  7. src/cmd/go/internal/bug/bug.go

    		}
    		return
    	}
    	fmt.Fprintf(w, "%s%s\n", prefix, bytes.TrimSpace(out))
    }
    
    // firstLine returns the first line of a given byte slice.
    func firstLine(buf []byte) []byte {
    	idx := bytes.IndexByte(buf, '\n')
    	if idx > 0 {
    		buf = buf[:idx]
    	}
    	return bytes.TrimSpace(buf)
    }
    
    // printGlibcVersion prints information about the glibc version.
    // It ignores failures.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/telemetry/internal/counter/parse.go

    		Count: make(map[string]uint64),
    	}
    	np := round(len(hdrPrefix), 4)
    	hdrLen := *(*uint32)(unsafe.Pointer(&data[np]))
    	if hdrLen > pageSize {
    		return corrupt()
    	}
    	meta := data[np+4 : hdrLen]
    	if i := bytes.IndexByte(meta, 0); i >= 0 {
    		meta = meta[:i]
    	}
    	m := &mappedFile{
    		meta:    string(meta),
    		hdrLen:  hdrLen,
    		mapping: &mmap.Data{Data: data},
    	}
    
    	lines := strings.Split(m.meta, "\n")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 14:38:01 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  9. pkg/config/kube/conversion.go

    	if len(name) >= grpcWebLen && strings.EqualFold(name[:grpcWebLen], grpcWeb) {
    		return protocol.GRPCWeb
    	}
    
    	// Parse the port name to find the prefix, if any.
    	i := strings.IndexByte(name, '-')
    	if i >= 0 {
    		name = name[:i]
    	}
    
    	p := protocol.Parse(name)
    	if p == protocol.Unsupported {
    		// Make TCP as default protocol for well know ports if protocol is not specified.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 29 02:03:58 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  10. src/debug/pe/string.go

    	"encoding/binary"
    	"fmt"
    	"internal/saferio"
    	"io"
    )
    
    // cstring converts ASCII byte sequence b to string.
    // It stops once it finds 0 or reaches end of b.
    func cstring(b []byte) string {
    	i := bytes.IndexByte(b, 0)
    	if i == -1 {
    		i = len(b)
    	}
    	return string(b[:i])
    }
    
    // StringTable is a COFF string table.
    type StringTable []byte
    
    func readStringTable(fh *FileHeader, r io.ReadSeeker) (StringTable, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 07 19:06:17 UTC 2023
    - 1.8K bytes
    - Viewed (0)
Back to top