Skip to content

Commit

Permalink
Remove usages of createObservableArray.getArray, see phetsims/axon#279
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Oct 12, 2020
1 parent b06f88f commit 3dbe48f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/common/model/EnergySkateParkSaveSampleModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class EnergySkateParkSaveSampleModel extends EnergySkateParkModel {
* @public
*/
clearEnergyData() {
this.batchRemoveSamples( this.dataSamples.getArray().slice() );
this.batchRemoveSamples( this.dataSamples.slice() );
this.sampleTimeProperty.reset();
}

Expand Down
4 changes: 2 additions & 2 deletions js/graphs/model/GraphsModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class GraphsModel extends EnergySkateParkTrackSetModel {
const indexOfSample = this.dataSamples.indexOf( closestSample );

assert && assert( indexOfSample >= 0, 'time of cursor needs to align with a skater sample' );
this.batchRemoveSamples( this.dataSamples.getArray().slice( indexOfSample ) );
this.batchRemoveSamples( this.dataSamples.slice( indexOfSample ) );
}
}
}
Expand Down Expand Up @@ -293,7 +293,7 @@ class GraphsModel extends EnergySkateParkTrackSetModel {
getClosestSkaterSample( time ) {
assert && assert( this.dataSamples.length > 0, 'model has no saved EnergySkateParkDataSamples to retrieve' );

let nearestIndex = _.sortedIndexBy( this.dataSamples.getArray(), { time: time }, entry => entry.time );
let nearestIndex = _.sortedIndexBy( this.dataSamples, { time: time }, entry => entry.time );
nearestIndex = Utils.clamp( nearestIndex, 0, this.dataSamples.length - 1 );

return this.dataSamples.get( nearestIndex );
Expand Down

0 comments on commit 3dbe48f

Please sign in to comment.