mirror of
https://github.com/jlfwong/speedscope.git
synced 2024-11-22 12:53:23 +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