- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for indexBytePortable (1.32 sec)
-
src/bytes/export_test.go
// Copyright 2009 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. package bytes // Export func for testing
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Wed Apr 24 00:56:36 UTC 2019 - 244 bytes - Viewed (0) -
src/bytes/bytes_test.go
continue } a := []byte(tt.a) b := tt.b[0] pos := IndexByte(a, b) if pos != tt.i { t.Errorf(`IndexByte(%q, '%c') = %v`, tt.a, b, pos) } posp := IndexBytePortable(a, b) if posp != tt.i { t.Errorf(`indexBytePortable(%q, '%c') = %v`, tt.a, b, posp) } } } func TestLastIndexByte(t *testing.T) { testCases := []BinOpTest{ {"", "q", -1}, {"abcdef", "q", -1},
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Mon Jul 28 18:13:58 UTC 2025 - 62.9K bytes - Viewed (0) -
src/bytes/bytes.go
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 } // LastIndex returns the index of the last instance of sep in s, or -1 if sep is not present in s.
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Wed Sep 03 14:04:47 UTC 2025 - 35.5K bytes - Viewed (0)