diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2015-12-19 20:44:01 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2015-12-19 20:44:01 +0200 |
commit | 052a3cfb650e47571e9f876e3f5e9bb4f1b2bf16 (patch) | |
tree | e66d692f54e9f5a93be01d27e3ff79039da7bea5 /bytesconv_timing_test.go | |
parent | Substitute AppendBytesStr by append() (diff) | |
download | fasthttp-052a3cfb650e47571e9f876e3f5e9bb4f1b2bf16.tar.gz fasthttp-052a3cfb650e47571e9f876e3f5e9bb4f1b2bf16.tar.bz2 fasthttp-052a3cfb650e47571e9f876e3f5e9bb4f1b2bf16.zip |
Substitute EqualBytesStr(s, b) by string(b) == s
Diffstat (limited to 'bytesconv_timing_test.go')
-rw-r--r-- | bytesconv_timing_test.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/bytesconv_timing_test.go b/bytesconv_timing_test.go index ef87973..6aa05a8 100644 --- a/bytesconv_timing_test.go +++ b/bytesconv_timing_test.go @@ -133,38 +133,3 @@ func BenchmarkLowercaseBytesMixed(b *testing.B) { } }) } - -func BenchmarkEqualBytesStrEq(b *testing.B) { - s := "foobarbaraz" - bs := []byte(s) - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - if !EqualBytesStr(bs, s) { - b.Fatalf("unexpected result: %q != %q", bs, s) - } - } - }) -} - -func BenchmarkEqualBytesStrNe(b *testing.B) { - s := "foobarbaraz" - bs := []byte(s) - bs[len(s)-1] = 'a' - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - if EqualBytesStr(bs, s) { - b.Fatalf("unexpected result: %q = %q", bs, s) - } - } - }) -} - -func BenchmarkAppendBytesStr(b *testing.B) { - s := "foobarbazbaraz" - b.RunParallel(func(pb *testing.PB) { - var dst []byte - for pb.Next() { - dst = AppendBytesStr(dst[:0], s) - } - }) -} |