On Thu, Apr 29, 2010 at 08:36:14AM +0000, cw@f00f.org wrote: > Description: > net: parser ...
14 years, 10 months ago
(2010-04-29 08:48:09 UTC)
#2
On Thu, Apr 29, 2010 at 08:36:14AM +0000, cw@f00f.org wrote:
> Description:
> net: parser should handle EOF without newline properly.
>
> Fixes issue 686.
I also did a small tweak wrt to copy and a ShortVarDecl change. I
would split the CL for that except I'm too lazy.
Sometimes I wish Rietveld would allow changesets from a local
repo/branch and cherry-picking from that.
> func (f *file) getLineFromData() (s string, ok bool) {
> data := f.data
> - for i := 0; i < len(data); i++ {
> + i := 0
> + for i = 0; i < len(data); i++ {
> if data[i] == '\n' {
> s = string(data[0:i])
> ok = true
> // move data
> i++
> n := len(data) - i
> - for j := 0; j < n; j++ {
> - data[j] = data[i+j]
> - }
> + copy(data[0:], data[i:])
> f.data = data[0:n]
> return
> }
> }
^- arguably blongs in a different CL
Issue 979044: code review 979044: net: parser should handle EOF without newline properly.
(Closed)
Created 14 years, 10 months ago by cw
Modified 14 years, 10 months ago
Reviewers:
Base URL:
Comments: 0