mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
parent
d8b5d039cd
commit
69c4e9380b
32 changed files with 109 additions and 404 deletions
|
|
@ -545,7 +545,7 @@ func resize(n int) int {
|
|||
// Add appends the contents of t to the end of s and returns the result.
|
||||
// If s has enough capacity, it is extended in place; otherwise a
|
||||
// new array is allocated and returned.
|
||||
func Add(s, t []byte) []byte {
|
||||
func Add(s, t []byte) []byte { // TODO
|
||||
lens := len(s)
|
||||
lent := len(t)
|
||||
if lens+lent <= cap(s) {
|
||||
|
|
@ -562,7 +562,7 @@ func Add(s, t []byte) []byte {
|
|||
// AddByte appends byte t to the end of s and returns the result.
|
||||
// If s has enough capacity, it is extended in place; otherwise a
|
||||
// new array is allocated and returned.
|
||||
func AddByte(s []byte, t byte) []byte {
|
||||
func AddByte(s []byte, t byte) []byte { // TODO
|
||||
lens := len(s)
|
||||
if lens+1 <= cap(s) {
|
||||
s = s[0 : lens+1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue