Skip to content

Commit

Permalink
refactor(View): simplify getLayerById method.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Feb 22, 2021
1 parent 1f7eb05 commit 58874ec
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Core/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,7 @@ class View extends THREE.EventDispatcher {
*/

getLayerById(layerId) {
const layers = this.getLayers(l => l.id === layerId);
if (layers.length) {
return layers[0];
}
return this.getLayers(l => l.id === layerId)[0];
}


Expand Down

0 comments on commit 58874ec

Please # to comment.