diff options
| author | Ian Lance Taylor <iant@golang.org> | 2021-07-30 14:28:58 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2021-08-12 20:23:07 -0700 |
| commit | c5b21c3f4c17b0649155035d2f9aa97b2da8a813 (patch) | |
| tree | c6d3a68b503ba5b16182acbb958e3e5dbc95a43b /libgo/go/golang.org/x/mod/modfile/read.go | |
| parent | 72be20e20299ec57b4bc9ba03d5b7d6bf10e97cc (diff) | |
| download | gcc-c5b21c3f4c17b0649155035d2f9aa97b2da8a813.tar.gz | |
libgo: update to Go1.17rc2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629
Diffstat (limited to 'libgo/go/golang.org/x/mod/modfile/read.go')
| -rw-r--r-- | libgo/go/golang.org/x/mod/modfile/read.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libgo/go/golang.org/x/mod/modfile/read.go b/libgo/go/golang.org/x/mod/modfile/read.go index 2a961ca81c2..956f30cbb39 100644 --- a/libgo/go/golang.org/x/mod/modfile/read.go +++ b/libgo/go/golang.org/x/mod/modfile/read.go @@ -194,12 +194,15 @@ func (x *FileSyntax) updateLine(line *Line, tokens ...string) { line.Token = tokens } -func (x *FileSyntax) removeLine(line *Line) { +// markRemoved modifies line so that it (and its end-of-line comment, if any) +// will be dropped by (*FileSyntax).Cleanup. +func (line *Line) markRemoved() { line.Token = nil + line.Comments.Suffix = nil } // Cleanup cleans up the file syntax x after any edit operations. -// To avoid quadratic behavior, removeLine marks the line as dead +// To avoid quadratic behavior, (*Line).markRemoved marks the line as dead // by setting line.Token = nil but does not remove it from the slice // in which it appears. After edits have all been indicated, // calling Cleanup cleans out the dead lines. |
