<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/strings/clone_test.go, branch dev.boringcrypto</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>strings: align Clone output with string([]byte(""))</title>
<updated>2021-11-01T14:45:28+00:00</updated>
<author>
<name>Martin Möhrmann</name>
<email>martin@golang.org</email>
</author>
<published>2021-11-01T05:42:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=82f902ae8e2b7f7eff0cdb087e47e939cc296a62'/>
<id>82f902ae8e2b7f7eff0cdb087e47e939cc296a62</id>
<content type='text'>
Add a comment how strings of length 0 are treated and
that they always will result in the return of a string
equal to the constant string "".

The previous implementation would return a string header that uses
runtime.zerobase as the backing array pointer while the string constant
"" has 0 as pointer value.

Using 0 has the backing array pointer is also the behaviour of
string([]byte(input)) which makes the new behaviour a better drop in
replacement.

Change-Id: Ic5460e9494b6708edbdfa4361e878d50db54ba10
Reviewed-on: https://go-review.googlesource.com/c/go/+/360255
Trust: Martin Möhrmann &lt;martin@golang.org&gt;
Run-TryBot: Martin Möhrmann &lt;martin@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a comment how strings of length 0 are treated and
that they always will result in the return of a string
equal to the constant string "".

The previous implementation would return a string header that uses
runtime.zerobase as the backing array pointer while the string constant
"" has 0 as pointer value.

Using 0 has the backing array pointer is also the behaviour of
string([]byte(input)) which makes the new behaviour a better drop in
replacement.

Change-Id: Ic5460e9494b6708edbdfa4361e878d50db54ba10
Reviewed-on: https://go-review.googlesource.com/c/go/+/360255
Trust: Martin Möhrmann &lt;martin@golang.org&gt;
Run-TryBot: Martin Möhrmann &lt;martin@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>strings: add Clone function</title>
<updated>2021-09-13T18:02:42+00:00</updated>
<author>
<name>Martin Möhrmann</name>
<email>martin@golang.org</email>
</author>
<published>2021-08-28T15:54:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e74e363a6b3e71ec5a49a3aae8c2523abb72faa7'/>
<id>e74e363a6b3e71ec5a49a3aae8c2523abb72faa7</id>
<content type='text'>
The new strings.Clone function copies the input string
without the returned cloned string referencing the
input strings memory.

goarch: amd64
cpu: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz

name     time/op
Clone-8  24.2ns ± 2%

name     alloc/op
Clone-8   48.0B ± 0%

name     allocs/op
Clone-8    1.00 ± 0%

Update #45038
Fixes #40200

Change-Id: Id9116c21c14328ec3931ef9a67a2e4f30ff301f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/345849
Trust: Martin Möhrmann &lt;martin@golang.org&gt;
Run-TryBot: Martin Möhrmann &lt;martin@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new strings.Clone function copies the input string
without the returned cloned string referencing the
input strings memory.

goarch: amd64
cpu: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz

name     time/op
Clone-8  24.2ns ± 2%

name     alloc/op
Clone-8   48.0B ± 0%

name     allocs/op
Clone-8    1.00 ± 0%

Update #45038
Fixes #40200

Change-Id: Id9116c21c14328ec3931ef9a67a2e4f30ff301f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/345849
Trust: Martin Möhrmann &lt;martin@golang.org&gt;
Run-TryBot: Martin Möhrmann &lt;martin@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
