Skip to content

Commit

Permalink
Skip the perf hit of filterVertices if the data is known to properly …
Browse files Browse the repository at this point in the history
…be processed
  • Loading branch information
twojtasz committed Oct 15, 2021
1 parent 7469a4d commit 6b1cd82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/parser/src/parsers/filter-vertices.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import {getXVIZConfig} from '../config/xviz-config';
// This reduces data size and works around an issue in the deck.gl PathLayer
export function filterVertices(vertices) {
const THRESHOLD = getXVIZConfig().pathDistanceThreshold;

if (THRESHOLD === 0.0) {
return vertices;
}
const isFlatArray = Number.isFinite(vertices[0]);
const vertexCount = isFlatArray ? vertices.length / 3 : vertices.length;

Expand Down

0 comments on commit 6b1cd82

Please sign in to comment.