Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 32 for Equals (0.23 sec)

  1. src/bytes/example_test.go

    		// a less b
    	}
    	if bytes.Compare(a, b) <= 0 {
    		// a less or equal b
    	}
    	if bytes.Compare(a, b) > 0 {
    		// a greater b
    	}
    	if bytes.Compare(a, b) >= 0 {
    		// a greater or equal b
    	}
    
    	// Prefer Equal to Compare for equality comparisons.
    	if bytes.Equal(a, b) {
    		// a equal b
    	}
    	if !bytes.Equal(a, b) {
    		// a not equal b
    	}
    }
    
    func ExampleCompare_search() {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  2. src/bytes/bytes_test.go

    		for i := 0; i < b.N; i++ {
    			eq := Equal(buf1, buf2)
    			if !eq {
    				b.Fatal("bad equal")
    			}
    		}
    	})
    
    	sizes := []int{1, 6, 9, 15, 16, 20, 32, 4 << 10, 4 << 20, 64 << 20}
    
    	b.Run("same", func(b *testing.B) {
    		benchBytes(b, sizes, bmEqual(func(a, b []byte) bool { return Equal(a, a) }))
    	})
    
    	benchBytes(b, sizes, bmEqual(Equal))
    }
    
    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)
  3. src/cmd/cgo/gcc.go

    		if _, ok := base(dt.Type).(*dwarf.VoidType); ok {
    			t.Go = c.goVoidPtr
    			t.C.Set("void*")
    			dq := dt.Type
    			for {
    				if d, ok := dq.(*dwarf.QualType); ok {
    					t.C.Set(d.Qual + " " + t.C.String())
    					dq = d.Type
    				} else {
    					break
    				}
    			}
    			break
    		}
    
    		// Placeholder initialization; completed in FinishType.
    		t.Go = &ast.StarExpr{}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Nov 02 16:43:23 GMT 2023
    - 97K bytes
    - Viewed (0)
  4. api/go1.txt

    pkg bytes, const MinRead ideal-int
    pkg bytes, func Compare([]uint8, []uint8) int
    pkg bytes, func Contains([]uint8, []uint8) bool
    pkg bytes, func Count([]uint8, []uint8) int
    pkg bytes, func Equal([]uint8, []uint8) bool
    pkg bytes, func EqualFold([]uint8, []uint8) bool
    pkg bytes, func Fields([]uint8) [][]uint8
    pkg bytes, func FieldsFunc([]uint8, func(int32) bool) [][]uint8
    pkg bytes, func HasPrefix([]uint8, []uint8) bool
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
  5. src/cmd/asm/internal/arch/arch.go

    	instructions["JCS"] = x86.AJCS  /* carry set (CF = 1) */
    	instructions["JE"] = x86.AJEQ   /* alternate */
    	instructions["JEQ"] = x86.AJEQ  /* equal (ZF = 1) */
    	instructions["JG"] = x86.AJGT   /* alternate */
    	instructions["JGE"] = x86.AJGE  /* greater than or equal (signed) (SF = OF) */
    	instructions["JGT"] = x86.AJGT  /* greater than (signed) (ZF = 0 && SF = OF) */
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Mar 21 06:51:28 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  6. api/go1.20.txt

    pkg crypto/ecdh, method (*PrivateKey) Equal(crypto.PrivateKey) bool #52221
    pkg crypto/ecdh, method (*PrivateKey) Public() crypto.PublicKey #52221
    pkg crypto/ecdh, method (*PrivateKey) PublicKey() *PublicKey #52221
    pkg crypto/ecdh, method (*PublicKey) Bytes() []uint8 #52221
    pkg crypto/ecdh, method (*PublicKey) Curve() Curve #52221
    pkg crypto/ecdh, method (*PublicKey) Equal(crypto.PublicKey) bool #52221
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Fri Feb 17 21:23:32 GMT 2023
    - 602.6K bytes
    - Viewed (0)
  7. doc/go_spec.html

    <p>
    Comparison operators compare two operands and yield an untyped boolean value.
    </p>
    
    <pre class="grammar">
    ==    equal
    !=    not equal
    &lt;     less
    &lt;=    less or equal
    &gt;     greater
    &gt;=    greater or equal
    </pre>
    
    <p>
    In any comparison, the first operand
    must be <a href="#Assignability">assignable</a>
    to the type of the second operand, or vice versa.
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu May 02 22:43:51 GMT 2024
    - 279.6K bytes
    - Viewed (0)
  8. doc/next/6-stdlib/2-unique.md

    Any value of comparable type may be canonicalized with the new
    `Make[T]` function, which produces a reference to a canonical copy of
    the value in the form of a `Handle[T]`.
    Two `Handle[T]` are equal if and only if the values used to produce the
    handles are equal, allowing programs to deduplicate values and reduce
    their memory footprint.
    Comparing two `Handle[T]` values is efficient, reducing down to a simple
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Wed Apr 24 13:37:36 GMT 2024
    - 579 bytes
    - Viewed (0)
  9. src/bytes/bytes.go

    // It is analogous to the facilities of the [strings] package.
    package bytes
    
    import (
    	"internal/bytealg"
    	"unicode"
    	"unicode/utf8"
    )
    
    // Equal reports whether a and b
    // are the same length and contain the same bytes.
    // A nil argument is equivalent to an empty slice.
    func Equal(a, b []byte) bool {
    	// Neither cmd/compile nor gccgo allocates for these string conversions.
    	return string(a) == string(b)
    }
    
    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)
  10. src/archive/zip/zip_test.go

    		}
    	}
    }
    
    func TestModTime(t *testing.T) {
    	var testTime = time.Date(2009, time.November, 10, 23, 45, 58, 0, time.UTC)
    	fh := new(FileHeader)
    	fh.SetModTime(testTime)
    	outTime := fh.ModTime()
    	if !outTime.Equal(testTime) {
    		t.Errorf("times don't match: got %s, want %s", outTime, testTime)
    	}
    }
    
    func testHeaderRoundTrip(fh *FileHeader, wantUncompressedSize uint32, wantUncompressedSize64 uint64, t *testing.T) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 19.5K bytes
    - Viewed (0)
Back to top