Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vg/recorder: invalid/unused Canvas.c field #771

Closed
sbinet opened this issue Sep 1, 2023 · 1 comment · Fixed by #772
Closed

vg/recorder: invalid/unused Canvas.c field #771

sbinet opened this issue Sep 1, 2023 · 1 comment · Fixed by #772

Comments

@sbinet
Copy link
Member

sbinet commented Sep 1, 2023

I was in the middle of implementing a JSON-based vg/recorder.Canvas (b/c of go-hep/hep#982), looking at the code in vg/recorder.

when I noticed:

func (c *Canvas) append(a Action) {
	if c.c != nil {
		a.ApplyTo(c)
	}
	c.Actions = append(c.Actions, a)
}

I think a.ApplyTo(c) should read a.ApplyTo(c.c).
right ?

but Canvas.c is never accessed (outside of Canvas.append, that is), and cannot be modified outside of vg/recorder.
so, couldn't we just get rid of this field ?

@kortschak
Copy link
Member

kortschak commented Sep 1, 2023 via email

sbinet added a commit to sbinet-gonum/plot that referenced this issue Sep 2, 2023
Fixes gonum#771.

Signed-off-by: Sebastien Binet <binet@cern.ch>
sbinet added a commit that referenced this issue Sep 2, 2023
Fixes #771.

Signed-off-by: Sebastien Binet <binet@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants