PurpleKingdomGames / tyrian

Elm-inspired Scala UI library.
https://tyrian.indigoengine.io/
MIT License
346 stars 26 forks source link

CmdHelper - Small optimisation. #213

Closed diesalbla closed 1 year ago

diesalbla commented 1 year ago

Replace the use of an accumulator list with a listBuffer. The advantage is that the last step to turn the acc listbuffer into a list can be done without allocating any objects, unlike the reverse which needs to do those allocations.

Note that this type of local use of mutable data structures, whose mutability does not scope the scope of a function body, is common in all the Scala codebase.

davesmith00000 commented 1 year ago

Thank you @diesalbla! :smile:

I kicked off a CI build and it looks like there's a small problem, probably just a stray annotation.

diesalbla commented 1 year ago

@davesmith00000 Could you try again?