daviddenton / refactoring-golf

A Refactoring Golf exercise
53 stars 37 forks source link

Solution to hole 6 #2

Open nickebbitt opened 6 years ago

nickebbitt commented 6 years ago

Hi there,

I ran a refactoring golf session at my company today, thanks very much for providing the code.

None of managed to solve hole 6, are you able to share the steps used to get a score of 7? We were hoping there'd be a nice refactoring in IntelliJ to switch the loop to a stream but that doesn't exist.

Thanks

Nick

augusto commented 3 years ago

I know this is old... but it looks like IntelliJ removed the intention to replace a for loop with the streams API. Doing a bit of googling, it was called foreach loop can be collapsed with the Stream API, and there's a screenshot attached of it to this youtrack ticket (from intellij 2016).

One might need to use an old version of intellij to get a 7 :)