1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:21:22 -06:00
Commit Graph

88 Commits

Author SHA1 Message Date
Nigel Tao
6a186d38d1 src/pkg: make package doc comments consistently start with "Package foo".
R=rsc
CC=golang-dev
https://golang.org/cl/4442064
2011-04-20 09:57:05 +10:00
Evan Shaw
47f4ae1a78 bytes, strings: simplify Join
R=gri, rsc
CC=golang-dev
https://golang.org/cl/4300044
2011-03-29 01:27:38 -04:00
Rob Pike
f0cf7d296c testing: shorten some tests.
These are the top runners.  More to come.
Also print two digits of timing info under -test.v.

R=rsc
CC=golang-dev
https://golang.org/cl/4317044
2011-03-25 16:31:10 -07:00
Evan Shaw
bbfad5f1cc bytes: fix bugs in buffer.ReadBytes
Fixes #1498.

R=golang-dev, mattn, r, rsc
CC=golang-dev
https://golang.org/cl/4140041
2011-02-11 12:39:18 -05:00
Robert Griesemer
4438f50293 buffer.go: minor optimization, expanded comment
R=r
CC=golang-dev
https://golang.org/cl/4169043
2011-02-09 15:09:08 -08:00
Evan Shaw
c9bf30cf19 bytes: Add Buffer.ReadBytes, Buffer.ReadString
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4000046
2011-01-27 14:00:31 -08:00
Rob Pike
7b4495c041 bytes.Buffer: fix typo in comment (doubled 'to')
R=ken2
CC=golang-dev
https://golang.org/cl/4035041
2011-01-14 23:00:02 -08:00
Peter Mundy
2b0a276129 bytes: fix TrimSpace typo
Fixes #1401.

R=golang-dev, agl1
CC=golang-dev
https://golang.org/cl/3937041
2011-01-09 12:11:16 -05:00
Rob Pike
353fd1014c bytes.Buffer: Fix bug in UnreadByte.
Error check was inverted.

Fixes #1396.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/3851042
2011-01-07 14:41:33 -08:00
Rob Pike
1ce6245d6c throughout: fix broken calls to Printf etc.
I have written a tool to verify Printf calls, and although it's not
ready to be reviewed yet it's already uncovered a spate of problems
in the repository.  I'm sending this CL to break the changes into
pieces; as the tool improves it will find more, I'm sure.

R=rsc
CC=golang-dev
https://golang.org/cl/3427043
2010-12-07 16:42:54 -05:00
Rob Pike
42cfe48ffc use the new %U format for runes
R=rsc
CC=golang-dev
https://golang.org/cl/3483041
2010-12-06 14:38:25 -05:00
Roger Peppe
415545e539 bytes: add Buffer.UnreadRune, Buffer.UnreadByte
R=rsc, r
CC=golang-dev
https://golang.org/cl/3421041
2010-12-06 14:10:10 -05:00
Kyle Consalus
009aebdba8 Removed bytes.Add and bytes.AddByte; we now have 'append'.
Changed all uses of bytes.Add (aside from those testing bytes.Add) to append(a, b...).
Also ran "gofmt -s" and made use of copy([]byte, string) in the fasta benchmark.

R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/3302042
2010-12-01 11:59:13 -08:00
Adam Langley
3cb4bdb9ce utf8: make EncodeRune's destination the first argument.
R=r
CC=golang-dev
https://golang.org/cl/3364041
2010-11-30 16:59:43 -05:00
Benny Siegert
8530e8ef65 strings: add LastIndexAny
The need for a LastIndexAny function has come up in the discussion
for https://golang.org/cl/3008041/. This function is
implemented analogously to lastIndexFunc, using functions from
the utf8 package.

R=r, rsc, PeterGo
CC=golang-dev
https://golang.org/cl/3057041
2010-11-12 12:47:50 -08:00
Evan Shaw
49fdfe21dd bytes: SSE for bytes.IndexByte on amd64
Performance on 2.8 GHz Intel Core i7:

Before:
BenchmarkIndexByte4K  1000000              2997 ns/op        1366.70 MB/s
BenchmarkIndexByte4M      500           3049772 ns/op        1375.28 MB/s
BenchmarkIndexByte64M      50          49582280 ns/op        1353.48 MB/s

After:
BenchmarkIndexByte4K 10000000               298 ns/op       13744.97 MB/s
BenchmarkIndexByte4M    10000            285993 ns/op       14665.76 MB/s
BenchmarkIndexByte64M     500           4618172 ns/op       14531.48 MB/s

R=rsc, PeterGo, r2, r
CC=golang-dev
https://golang.org/cl/2888041
2010-11-08 17:33:53 -08:00
Russ Cox
69c4e9380b use append
R=gri, r, r2
CC=golang-dev
https://golang.org/cl/2743042
2010-10-27 19:47:23 -07:00
Russ Cox
d86ab015f7 use copy
R=gri
CC=golang-dev
https://golang.org/cl/2763041
2010-10-26 21:52:54 -07:00
Robert Griesemer
3478891d12 gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Andrew Gerrand
b15b0a0cd9 bytes: fix typo in AddByte comment
Fixes #1140.

R=golang-dev
CC=golang-dev
https://golang.org/cl/2240043
2010-09-27 11:41:43 +10:00
Roger Peppe
81ba399a6a bytes, strings: change lastIndexFunc to use DecodeLastRune
R=r
CC=golang-dev, rsc
https://golang.org/cl/2271041
2010-09-23 20:40:11 +10:00
Rob Pike
1959c3ac5b tests: fix prints
- delete unnecessary newlines
- make sure formatted prints call the formatting routines

R=adg
CC=golang-dev
https://golang.org/cl/2225046
2010-09-23 13:48:56 +10:00
Russ Cox
da392d9136 build: no required environment variables
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Christian Himpel
75f6a0c759 bytes: add IndexRune, FieldsFunc and To*Special
Basically these functions are implemented the same way as the
corresponding functions in the strings package.  Test functions
are implemented for IndexRune and FieldsFunc.

Additionally two typos are fixed in packages bytes and strings.

R=r
CC=golang-dev
https://golang.org/cl/1696062
2010-08-05 23:11:06 +10:00
Scott Lawrence
99aab8bacb bytes: added test case for explode with blank string.
Tests for the equivalent of the strings.explode("") panic bug (issue 980).

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1850052
2010-08-04 13:33:24 +10:00
Andrew Gerrand
8b821696cc bytes, strings: mention the n < 0 case in Split/SplitAfter doc comment
R=r, rsc
CC=golang-dev
https://golang.org/cl/1669055
2010-07-27 15:06:08 +10:00
Fazlul Shahriar
e356f1d88f bytes: port IndexFunc and LastIndexFunc from strings package
This CL basically applies the same changes as

	http://code.google.com/p/go/source/detail?r=5e0a29014e8e

but for bytes package.

R=r, rog
CC=golang-dev
https://golang.org/cl/1670052
2010-07-23 12:34:35 -07:00
Andrey Mirtchovski
8629e5a648 strings.Bytes: fix typo in comment
R=adg, rsc
CC=golang-dev
https://golang.org/cl/1886042
2010-07-21 12:01:15 -07:00
Rob Pike
de228c0e0c bytes: add Title
R=rsc
CC=golang-dev
https://golang.org/cl/1872042
2010-07-20 19:53:59 -07:00
Rob Pike
38f1231f3e strings and bytes.Split: make count of 0 mean 0, not infinite.
Use a count of -1 for infinity.  Ditto for Replace.

R=rsc
CC=golang-dev
https://golang.org/cl/1704044
2010-07-01 14:08:14 -07:00
Russ Cox
0bf413ab8e bytes, strings: add Replace
This is the Replace I suggested in the review of CL 1114041.
It's true that we already have

	regexp.MustCompile(regexp.QuoteMeta(old)).ReplaceAll(s, new)

but because this Replace is doing a simpler job it is
simpler to call and inherently more efficient.

I will add the bytes implementation and tests to the
CL after the strings one has been reviewed.

R=r, cw
CC=golang-dev
https://golang.org/cl/1731048
2010-06-30 18:03:09 -07:00
Russ Cox
44ca04d3d6 big, bytes: move assembly externs to separate file
to make it easier to build package without assembly.

R=r, r2
CC=golang-dev
https://golang.org/cl/1680045
2010-06-21 19:53:08 -07:00
Rob Pike
9baa7a51ba bytes.Buffer.ReadFrom: fix bug.
Fixes #852.

R=rsc
CC=golang-dev
https://golang.org/cl/1680042
2010-06-15 17:40:47 -07:00
Russ Cox
bb84f4b5d2 changes &x -> x[0:] for array to slice conversion
R=gri
CC=golang-dev
https://golang.org/cl/1326042
2010-05-27 14:51:47 -07:00
Michael Hoisie
4a3cb1ad2f bytes: add Trim, TrimLeft, TrimRight, and generic functions
R=rsc, r
CC=golang-dev
https://golang.org/cl/946045
2010-05-18 23:01:05 -07:00
Rob Pike
e1d20d0a51 bytes: Change IndexAny to look for UTF-8 encoded characters.
Also improve the implementations of Equals and Compare.

R=rsc
CC=golang-dev
https://golang.org/cl/969047
2010-05-03 10:59:00 -07:00
Russ Cox
78551a9b43 bytes: add Next method to Buffer, simplify Read.
R=r
CC=golang-dev
https://golang.org/cl/980043
2010-04-26 10:02:01 -07:00
Russ Cox
1baf35e41f bytes: shuffle implementation, making WriteByte 50% faster
R=r
CC=golang-dev
https://golang.org/cl/920041
2010-04-14 01:52:56 -07:00
Russ Cox
00f9f0c056 single argument panic
note that sortmain.go has been run through hg gofmt;
only the formatting of the day initializers changed.
i'm happy to revert that formatting if you'd prefer.

stop on error in doc/progs/run

R=r
CC=golang-dev
https://golang.org/cl/850041
2010-03-30 10:34:57 -07:00
Robert Griesemer
d0ffee8abf bytes, strings: IndexOfAny
+ first use in go/doc

R=r
CC=golang-dev
https://golang.org/cl/781041
2010-03-26 13:05:04 -07:00
Rob Pike
8c9944d8c8 bufio: WriteRune
also fix a printing error in the test for bytes.Buffer

R=golang-dev
CC=golang-dev
https://golang.org/cl/240042
2010-03-05 14:03:17 -08:00
Rob Pike
0ac5ef70db Add ReadRune and WriteRune to bytes.Buffer
The comments mention bufio's WriteRune, which should come next.

R=rsc
CC=golang-dev
https://golang.org/cl/245041
2010-03-05 11:34:53 -08:00
Russ Cox
9750adbbad strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports

R=r
CC=golang-dev
https://golang.org/cl/224062
2010-02-25 16:01:29 -08:00
Robert Griesemer
cd72f77f23 apply gofmt to src and misc
R=rsc
CC=golang-dev
https://golang.org/cl/213041
2010-02-17 15:46:46 -08:00
Russ Cox
718be3215f in C and asm, replace pkg·name with ·name
(eliminate assumption of package global name space,
make code easier to move between packages).

R=r
CC=golang-dev
https://golang.org/cl/194072
2010-01-25 18:52:55 -08:00
Yongjian Xu
ca0def6659 Remove redundant size check in resize. Let callers worry about that and resize should just do "resize".
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/181111
2010-01-02 11:09:22 +11:00
Rob Pike
1f0e6a4c99 new comments for bytes.NewBuffer and NewBufferString.
corrects a common misunderstanding about NewBuffer.

R=rsc
CC=golang-dev
https://golang.org/cl/179106
2009-12-19 08:42:31 +11:00
Andrey Mirtchovski
7f501c06f7 bytes, strings: add new function Fields
R=rsc, r, phf
CC=golang-dev
https://golang.org/cl/170046
2009-12-15 21:09:55 -08:00
Robert Griesemer
5a1d3323fe 1) Change default gofmt default settings for
parsing and printing to new syntax.

                  Use -oldparser to parse the old syntax,
                  use -oldprinter to print the old syntax.

               2) Change default gofmt formatting settings
                  to use tabs for indentation only and to use
                  spaces for alignment. This will make the code
                  alignment insensitive to an editor's tabwidth.

                  Use -spaces=false to use tabs for alignment.

               3) Manually changed src/exp/parser/parser_test.go
                  so that it doesn't try to parse the parser's
                  source files using the old syntax (they have
                  new syntax now).

               4) gofmt -w src misc test/bench

	       1st set of files.

R=rsc
CC=agl, golang-dev, iant, ken2, r
https://golang.org/cl/180047
2009-12-15 15:33:31 -08:00
Rob Pike
d14c813377 When the buffer is empty, reset b.off to the beginning of the buffer
to avoid growing unnecessarily.

R=rsc
CC=golang-dev
https://golang.org/cl/176071
2009-12-14 13:13:01 +11:00