Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for containsRune (0.09 sec)

  1. src/bytes/example_test.go

    	// true
    	// false
    	// false
    }
    
    func ExampleContainsRune() {
    	fmt.Println(bytes.ContainsRune([]byte("I like seafood."), 'f'))
    	fmt.Println(bytes.ContainsRune([]byte("I like seafood."), 'ö'))
    	fmt.Println(bytes.ContainsRune([]byte("去是伟大的!"), '大'))
    	fmt.Println(bytes.ContainsRune([]byte("去是伟大的!"), '!'))
    	fmt.Println(bytes.ContainsRune([]byte(""), '@'))
    	// Output:
    	// true
    	// false
    	// true
    	// true
    	// false
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 07 17:22:36 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  2. src/bytes/bytes.go

    func (as *asciiSet) contains(c byte) bool {
    	return (as[c/32] & (1 << (c % 32))) != 0
    }
    
    // containsRune is a simplified version of strings.ContainsRune
    // to avoid importing the strings package.
    // We avoid bytes.ContainsRune to avoid allocating a temporary copy of s.
    func containsRune(s string, r rune) bool {
    	for _, c := range s {
    		if c == r {
    			return true
    		}
    	}
    	return false
    }
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Sep 03 20:55:15 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  3. internal/hash/checksum.go

    func NewChecksumWithType(alg ChecksumType, value string) *Checksum {
    	if !alg.IsSet() {
    		return nil
    	}
    	wantParts := 0
    	if strings.ContainsRune(value, '-') {
    		valSplit := strings.Split(value, "-")
    		if len(valSplit) != 2 {
    			return nil
    		}
    		value = valSplit[0]
    		nParts, err := strconv.Atoi(valSplit[1])
    		if err != nil {
    			return nil
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Sep 19 12:59:07 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  4. chainable_api.go

    	return
    }
    
    // Omit specify fields that you want to ignore when creating, updating and querying
    func (db *DB) Omit(columns ...string) (tx *DB) {
    	tx = db.getInstance()
    
    	if len(columns) == 1 && strings.ContainsRune(columns[0], ',') {
    		tx.Statement.Omits = strings.FieldsFunc(columns[0], utils.IsValidDBNameChar)
    	} else {
    		tx.Statement.Omits = columns
    	}
    	return
    }
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 24 09:42:59 UTC 2024
    - 14.8K bytes
    - Viewed (0)
  5. src/bytes/bytes_test.go

    func TestContainsRune(t *testing.T) {
    	for _, ct := range ContainsRuneTests {
    		if ContainsRune(ct.b, ct.r) != ct.expected {
    			t.Errorf("ContainsRune(%q, %q) = %v, want %v",
    				ct.b, ct.r, !ct.expected, ct.expected)
    		}
    	}
    }
    
    func TestContainsFunc(t *testing.T) {
    	for _, ct := range ContainsRuneTests {
    		if ContainsFunc(ct.b, func(r rune) bool {
    			return ct.r == r
    		}) != ct.expected {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Aug 19 19:09:04 UTC 2024
    - 61.2K bytes
    - Viewed (0)
  6. cmd/object-api-utils.go

    	}
    	// This is valid for AWS S3 but it will never
    	// work with file systems, we will reject here
    	// to return object name invalid rather than
    	// a cryptic error from the file system.
    	return !strings.ContainsRune(object, 0)
    }
    
    // checkObjectNameForLengthAndSlash -check for the validity of object name length and prefis as slash
    func checkObjectNameForLengthAndSlash(bucket, object string) error {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Aug 08 15:29:58 UTC 2024
    - 37.1K bytes
    - Viewed (0)
  7. docs/debugging/xl-meta/main.go

    			if m.objSize == 0 {
    				m.objSize = ei.V2Obj.Size
    			}
    			m.data = ei.V2Obj.EcM
    			m.parity = ei.V2Obj.EcN
    			if len(ei.V2Obj.PartNums) == 1 && !strings.ContainsRune(ei.V2Obj.MetaUsr.Etag, '-') {
    				m.wantMD5 = ei.V2Obj.MetaUsr.Etag
    			}
    			if m.shards == 0 {
    				m.shards = m.data + m.parity
    			}
    			idx = ei.V2Obj.EcIndex - 1
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Sep 05 11:57:44 UTC 2024
    - 40.3K bytes
    - Viewed (0)
  8. src/cmd/cgo/gcc.go

    		prefix = "C"
    	}
    	n.Mangle = prefix + n.Kind + "_" + n.Go
    }
    
    func (f *File) isMangledName(s string) bool {
    	t, ok := strings.CutPrefix(s, "_C")
    	if !ok {
    		return false
    	}
    	return slices.ContainsFunc(nameKinds, func(k string) bool {
    		return strings.HasPrefix(t, k+"_")
    	})
    }
    
    // rewriteCalls rewrites all calls that pass pointers to check that
    // they follow the rules for passing pointers between Go and C.
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Sep 18 15:07:34 UTC 2024
    - 97.1K bytes
    - Viewed (0)
Back to top