Skip to content

Commit

Permalink
Convert field to local and preallocate array list capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes committed Oct 8, 2020
1 parent 3d21ad9 commit cfd541e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Source/com/drew/metadata/mov/atoms/TimeToSampleAtom.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@
*/
public class TimeToSampleAtom extends FullAtom
{
long numberOfEntries;
ArrayList<Entry> entries;
private final ArrayList<Entry> entries;

public TimeToSampleAtom(SequentialReader reader, Atom atom) throws IOException
{
super(reader, atom);

numberOfEntries = reader.getUInt32();
entries = new ArrayList<Entry>();
long numberOfEntries = reader.getUInt32();
entries = new ArrayList<Entry>((int)numberOfEntries);
for (int i = 0; i < numberOfEntries; i++) {
entries.add(new Entry(reader));
}
Expand Down

0 comments on commit cfd541e

Please sign in to comment.