mirror of
https://github.com/jlfwong/speedscope.git
synced 2024-11-22 22:14:25 +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) {
|
appendSampleWithWeight(stack: FrameInfo[], weight: number) {
|
||||||
if (weight === 0) {
|
if (weight === 0 || weight < 0) {
|
||||||
// Samples with zero weight have no effect, so let's ignore them
|
// Samples with zero or negative weight have no effect, so let's ignore them
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (weight < 0) {
|
|
||||||
throw new Error('Samples must have positive weights')
|
|
||||||
}
|
|
||||||
|
|
||||||
this._appendSample(stack, weight, true)
|
this._appendSample(stack, weight, true)
|
||||||
this._appendSample(stack, weight, false)
|
this._appendSample(stack, weight, false)
|
||||||
|
Loading…
Reference in New Issue
Block a user