Closed eganjs closed 4 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
shuffle
SecureRandom
Deck
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 ofSecureRandom
, this is unnecessary and the variable should be moved up to be an instance variable of theDeck
class so that it is only created once perDeck