mirror of
https://github.com/jlfwong/speedscope.git
synced 2024-11-26 07:35:55 +03:00
chore: ignore stack with negative sample
This commit is contained in:
parent
e37f6fa7c3
commit
77dfa69d91
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user