mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-22 15:49:53 +01:00
[android] improve bitmap transformation hashKey and DiskCacheKey
This commit is contained in:
@@ -98,14 +98,14 @@ class ImageCornerTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return ID.hashCode() + smallRadius * 100 + radius * 10 +
|
return ID.hashCode() + (smallRadius << 16) ^ (radius << 2) ^
|
||||||
(leftCornerSmall ? 9 : 8) + (bottomRound ? 7 : 6);
|
(leftCornerSmall ? 2 : 0) ^ (bottomRound ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
|
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
|
||||||
messageDigest.update((ID + smallRadius + radius + leftCornerSmall +
|
messageDigest.update((ID + '|' + smallRadius + '|' + radius + '|' +
|
||||||
bottomRound).getBytes(CHARSET));
|
leftCornerSmall + '|' + bottomRound).getBytes(CHARSET));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user