Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for BenchmarkCompareBytesEqual (0.4 sec)

  1. src/bytes/compare_test.go

    			a[j+1] = b[j+1] - 1
    			cmp = Compare(a[:i], b[:i])
    			if cmp != 1 {
    				t.Errorf(`CompareAbigger(%d,%d) = %d`, i, j, cmp)
    			}
    			a[j] = b[j]
    			a[j+1] = b[j+1]
    		}
    	}
    }
    
    func BenchmarkCompareBytesEqual(b *testing.B) {
    	b1 := []byte("Hello Gophers!")
    	b2 := []byte("Hello Gophers!")
    	for i := 0; i < b.N; i++ {
    		if Compare(b1, b2) != 0 {
    			b.Fatal("b1 != b2")
    		}
    	}
    }
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Thu Jul 13 23:11:42 UTC 2023
    - 6.8K bytes
    - Viewed (0)
Back to top