RustPython / Parser

MIT License
72 stars 28 forks source link

Avoid removing elements from the head of a vec #69

Closed MichaReiser closed 1 year ago

MichaReiser commented 1 year ago

This changes the parsing of ExpressionStatement to use pop with an IntoIterator instead of removing elements from the beginning of the vec. Removing elements from the beginning involves moving all following elements by one offset.

I don't expect this to improve performance significantly because it's rare that values contains more than a few elements.