Make Track[Group|GroupArray|Selection] consistent.

- I don't think the length is useful in hashCode; if the length
  is different then Arrays.hashCode should account for that.
- "this." just for consistency across these classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=116641142
This commit is contained in:
olly 2016-03-08 03:42:19 -08:00 committed by Oliver Woodman
parent 00191848f7
commit 9c98c4bb10
2 changed files with 2 additions and 6 deletions

View file

@ -58,7 +58,7 @@ public final class TrackGroup {
Assertions.checkState(formats.length > 0);
this.adaptive = adaptive;
this.formats = formats;
length = formats.length;
this.length = formats.length;
}
/**
@ -77,7 +77,6 @@ public final class TrackGroup {
int result = 17;
result = 31 * result + (adaptive ? 1231 : 1237);
result = 31 * result + Arrays.hashCode(formats);
result = 31 * result + length;
hashCode = result;
}
return hashCode;

View file

@ -53,10 +53,7 @@ public final class TrackGroupArray {
@Override
public int hashCode() {
if (hashCode == 0) {
int result = 17;
result = 31 * result + Arrays.hashCode(trackGroups);
result = 31 * result + length;
hashCode = result;
hashCode = Arrays.hashCode(trackGroups);
}
return hashCode;
}