icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Use extend() with iterator as appropriate in normalizer and collator

Open hsivonen opened this issue 3 years ago • 5 comments
trafficstars

Instead of pushing in a loop, use extend.

hsivonen avatar Aug 30 '22 14:08 hsivonen

I would like to try and tackle this issue. Two questions if you don't mind me asking:

  • should I introduce new benchmark for the functionality to measure if the suggestion helped?
  • I found another instance of mentioned code pattern (for ... vec.push) in the same file, should I replace it too?

kelebra avatar Sep 08 '22 03:09 kelebra

There are a few instances across those two crates, they should all be updated. I don't think benchmarks are necessary.

robertbastian avatar Sep 08 '22 10:09 robertbastian

Does #2531 fix this issue?

sffc avatar Sep 08 '22 16:09 sffc

I'm pretty sure there were more than 2 instances

robertbastian avatar Sep 08 '22 17:09 robertbastian

I can handle remaining instances later today 👍

kelebra avatar Sep 08 '22 17:09 kelebra

@hsivonen Can you set an assignee (or "help wanted") and a milestone (or "backlog")?

sffc avatar Oct 17 '22 21:10 sffc

@hsivonen @kelebra Is this issue fixed?

sffc avatar Dec 01 '22 19:12 sffc

I think I addressed all the remaining cases in the PR before, so should be fixed.

kelebra avatar Dec 01 '22 22:12 kelebra

I can take care of that, would you mind assigning this to me?

kelebra avatar Dec 02 '22 19:12 kelebra

@kelebra I can't assign the issue since you're not currently in the org, but feel free to contribute a PR!

sffc avatar Dec 02 '22 21:12 sffc

I take that this is fixed now; thanks, @kelebra!

sffc avatar Dec 05 '22 09:12 sffc