rxsnappy icon indicating copy to clipboard operation
rxsnappy copied to clipboard

Improve key generation helper

Open pakoito opened this issue 8 years ago • 2 comments

Object... is not an explicit contract. There is no indication that the operation could take long due to serialization + Base64, and it doesn't recommend caching or anything of the sorts. Serialization may cause unintended crashes for non-serializable objects.

As small tweaks, you should move the nullcheck atop the method to avoid allocating the StringBuilder or copying the reference prematurely.

https://github.com/team-supercharge/rxsnappy/blob/master/rxsnappy/src/main/java/io/supercharge/rxsnappy/RxSnappyUtils.java#L39

pakoito avatar Dec 02 '15 00:12 pakoito