GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix itertools chain by rng-dynamics · Pull Request #3788 · RustPython/RustPython Conversation
Contributor
Fix #3787
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
rng-dynamics
marked this pull request as draft
fanninpm
reviewed
Comment on lines
79
to
99
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📎 "It looks like you're if let Some(source) = zelf.source.read().clone() { loop { if let Some(active) = zelf.active.read().clone() { match active.next(vm) { Ok(PyIterReturn::Return(ok)) => { return Ok(PyIterReturn::Return(ok)); } Ok(PyIterReturn::StopIteration(_)) => { *zelf.active.write() = None; } Err(err) => { return Err(err); } } } else { match source.next(vm) { Ok(PyIterReturn::Return(ok)) => { *zelf.active.write() = Some(ok.get_iter(vm)?); } Ok(PyIterReturn::StopIteration(_)) => { return Ok(PyIterReturn::StopIteration(None)); } Err(err) => { return Err(err); } } } } } else { Ok(PyIterReturn::StopIteration(None)) }
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
youknowone
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! The changes looks good.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+68
to
+70
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I have different suggestion to @fanninpm's one. Let's keep indent depth shallower
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
|
Thanks for the suggestions. I tried to incorporate them and I tried to reduce the nesting. I also removed the closure which I didn't like that much. Let me know what you think. If you have more suggestions, I'd be happy to hear them.
The main reason was the clippy test which failed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It fixed the ridiculously slow running of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
itertools.chain should evaluate lazily
There was an error while loading. Please reload this page.