hammundo / BlackjackAndroidApp

0 stars 0 forks source link

Make local variable `sr` an instance variable #5

Closed eganjs closed 4 years ago

eganjs commented 5 years ago

https://github.com/hammundo/BlackjackAndroidApp/blob/ad6deed5bc1c8bceb7ec8ea49605dc0b2403ae7e/app/src/main/java/com/example/blackjack_android_app/Deck.java#L161

See instance variable

Every call to the shuffle method will create a new instance of SecureRandom, this is unnecessary and the variable should be moved up to be an instance variable of the Deck class so that it is only created once per Deck