Commit 9c98c4bb by olly Committed by Oliver Woodman

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
parent 00191848
......@@ -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;
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment