-
Notifications
You must be signed in to change notification settings - Fork 205
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
Change iterable interface to be more flexible #3255
Conversation
6b09c26
to
41c7628
Compare
|
||
remote_file( | ||
name = "golangci-lint", | ||
binary = True, | ||
exported_files = ["golangci-lint-%s-${OS}-${ARCH}/golangci-lint" % GO_CI_LINT_VERSION], | ||
extract = True, | ||
hashes = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we really need the hashes on this, we don't actually build it into anything
} | ||
|
||
// An indexable represents an object that knows its length and can be indexed into. | ||
type indexable interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially missing pyObject
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't really matter as such - most of the others don't have it. I'll make them consistent.
Rather than using length + index for everything, this leverages 1.23 iterators. It doesn't really change much fundamental yet, but does move towards being able to iterate things like dicts without extra list allocations.
Benchmarks locally actually seem to do slightly better. I'm not really sure why - I don't especially expect this to improve things dramatically as is - but the main thing is it's not getting worse.