Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/lib/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,10 @@ export class StackListProfileBuilder extends Profile {
}

appendSampleWithWeight(stack: FrameInfo[], weight: number) {
if (weight === 0) {
// Samples with zero weight have no effect, so let's ignore them
if (weight === 0 || weight < 0) {
// Samples with zero or negative weight have no effect, so let's ignore them
return
}
if (weight < 0) {
throw new Error('Samples must have positive weights')
}

this._appendSample(stack, weight, true)
this._appendSample(stack, weight, false)
Expand Down