Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for indexType (0.2 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 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  2. api/go1.2.txt

    pkg runtime, type MemStats struct, OtherSys uint64
    pkg runtime/debug, func SetMaxStack(int) int
    pkg runtime/debug, func SetMaxThreads(int) int
    pkg sort, func Stable(Interface)
    pkg strings, func IndexByte(string, uint8) int
    pkg sync/atomic, func SwapInt32(*int32, int32) int32
    pkg sync/atomic, func SwapInt64(*int64, int64) int64
    pkg sync/atomic, func SwapPointer(*unsafe.Pointer, unsafe.Pointer) unsafe.Pointer
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 18 04:36:59 GMT 2013
    - 1.9M bytes
    - Viewed (2)
  3. 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 30 11:13:12 GMT 2024
    - Last Modified: Thu Nov 30 20:05:58 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  4. src/archive/tar/strconv.go

    }
    
    // parseString parses bytes as a NUL-terminated C-style string.
    // If a NUL byte is not found then the whole slice is returned as a string.
    func (*parser) parseString(b []byte) string {
    	if i := bytes.IndexByte(b, 0); i >= 0 {
    		return string(b[:i])
    	}
    	return string(b)
    }
    
    // formatString copies s into b, NUL-terminating if possible.
    func (f *formatter) formatString(b []byte, s string) {
    	if len(s) > len(b) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Aug 01 14:28:42 GMT 2023
    - 9K bytes
    - Viewed (0)
  5. src/bytes/buffer.go

    	line = append(line, slice...)
    	return line, err
    }
    
    // readSlice is like ReadBytes but returns a reference to internal buffer data.
    func (b *Buffer) readSlice(delim byte) (line []byte, err error) {
    	i := IndexByte(b.buf[b.off:], delim)
    	end := b.off + i + 1
    	if i < 0 {
    		end = len(b.buf)
    		err = io.EOF
    	}
    	line = b.buf[b.off:end]
    	b.off = end
    	b.lastRead = opRead
    	return line, err
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  6. 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 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  7. 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 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  8. 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 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  9. api/go1.txt

    pkg bytes, func HasPrefix([]uint8, []uint8) bool
    pkg bytes, func HasSuffix([]uint8, []uint8) bool
    pkg bytes, func Index([]uint8, []uint8) int
    pkg bytes, func IndexAny([]uint8, string) int
    pkg bytes, func IndexByte([]uint8, uint8) int
    pkg bytes, func IndexFunc([]uint8, func(int32) bool) int
    pkg bytes, func IndexRune([]uint8, int32) int
    pkg bytes, func Join([][]uint8, []uint8) []uint8
    pkg bytes, func LastIndex([]uint8, []uint8) int
    Plain Text
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
  10. src/bufio/scan.go

    // newline.
    func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) {
    	if atEOF && len(data) == 0 {
    		return 0, nil, nil
    	}
    	if i := bytes.IndexByte(data, '\n'); i >= 0 {
    		// We have a full newline-terminated line.
    		return i + 1, dropCR(data[0:i]), nil
    	}
    	// If we're at EOF, we have a final, non-terminated line. Return it.
    	if atEOF {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 14.2K bytes
    - Viewed (0)
Back to top