Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAvoid allocations when joining strings #7776
Conversation
|
Reviewed 1 of 1 files at r1, 4 of 4 files at r2. Comments from the review on Reviewable.io |
|
@bors-servo r+ |
|
|
Avoid allocations when joining strings <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7776) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
Avoid allocations when joining strings <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7776) <!-- Reviewable:end -->
|
|
|
This changes behaviour in the face of empty strings in the iterator, I think. Did you confirm that can't happen? |
|
How does the behavior change with empty strings? |
|
Joining |
|
Ah, that's what you meant. I'm not sure about cssstyledeclaration.rs, but with the other two DOM instances, I think we're just going to eventually strip away the whitespace (they're being joined together by |
|
In cssstyledeclaration, this is run on the result of |
|
I'm planning to open a PR later that will make |
Prior to this commit, `str_join` would skip empty items at the start of the `Iterator` until it found a non-empty item. This contradicts `SliceConcatExt::join` which doesn't skip anything. Brought up in: servo#7776 (comment)
|
PR opened #7806 |
Make util::str::str_join consistent with SliceConcatExt::join Prior to this commit, `str_join` would skip empty items at the start of the `Iterator` until it found a non-empty item. This contradicts `SliceConcatExt::join` which doesn't skip anything. Brought up in: #7776 (comment) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7806) <!-- Reviewable:end -->
Make util::str::str_join consistent with SliceConcatExt::join Prior to this commit, `str_join` would skip empty items at the start of the `Iterator` until it found a non-empty item. This contradicts `SliceConcatExt::join` which doesn't skip anything. Brought up in: #7776 (comment) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7806) <!-- Reviewable:end -->
…ncatExt::join (from frewsxcv:consistent-str-join); r=mbrubeck Prior to this commit, `str_join` would skip empty items at the start of the `Iterator` until it found a non-empty item. This contradicts `SliceConcatExt::join` which doesn't skip anything. Brought up in: servo/servo#7776 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: 520c907742afbb94085c6b5e62156a5457530010
…ncatExt::join (from frewsxcv:consistent-str-join); r=mbrubeck Prior to this commit, `str_join` would skip empty items at the start of the `Iterator` until it found a non-empty item. This contradicts `SliceConcatExt::join` which doesn't skip anything. Brought up in: servo/servo#7776 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: 520c907742afbb94085c6b5e62156a5457530010 UltraBlame original commit: ce33507715eacf6a421095c1da08d2c4326d34ef
…ncatExt::join (from frewsxcv:consistent-str-join); r=mbrubeck Prior to this commit, `str_join` would skip empty items at the start of the `Iterator` until it found a non-empty item. This contradicts `SliceConcatExt::join` which doesn't skip anything. Brought up in: servo/servo#7776 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: 520c907742afbb94085c6b5e62156a5457530010 UltraBlame original commit: ce33507715eacf6a421095c1da08d2c4326d34ef
…ncatExt::join (from frewsxcv:consistent-str-join); r=mbrubeck Prior to this commit, `str_join` would skip empty items at the start of the `Iterator` until it found a non-empty item. This contradicts `SliceConcatExt::join` which doesn't skip anything. Brought up in: servo/servo#7776 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: 520c907742afbb94085c6b5e62156a5457530010 UltraBlame original commit: ce33507715eacf6a421095c1da08d2c4326d34ef
frewsxcv commentedSep 28, 2015