Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

gps: simplify x = x <op> y to x <op>= y#2028

Closed
quasilyte wants to merge 1 commit intogolang:masterfrom
quasilyte:quasilyte/assignOp
Closed

gps: simplify x = x <op> y to x <op>= y#2028
quasilyte wants to merge 1 commit intogolang:masterfrom
quasilyte:quasilyte/assignOp

Conversation

@quasilyte
Copy link
Copy Markdown
Contributor

Simplify x += 1 further to x++.

Signed-off-by: Iskander Sharipov quasilyte@gmail.com

Simplify `x += 1` further to `x++`.

Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
Comment thread gps/metrics.go
func (m *metrics) push(name string) {
cn := m.stack[len(m.stack)-1]
m.times[cn] = m.times[cn] + time.Since(m.last)
m.times[cn] += +time.Since(m.last)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of the + before the time here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry. It should be omitted. Thanks for spotting.

@kevinburke
Copy link
Copy Markdown
Collaborator

This has been merged! Closing.

@kevinburke kevinburke closed this Mar 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants