mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 00:27:58 +00:00
Revert "small optimization to avoid setting the same value twice"
This reverts commit 3208497102
.
This commit is contained in:
parent
3208497102
commit
6f4ad826a0
1 changed files with 2 additions and 8 deletions
|
@ -103,8 +103,8 @@ implements AbstractParam<Type> {
|
|||
}
|
||||
set value(value: Type) {
|
||||
this._initialValue = this._fromType(value);
|
||||
this.cancelScheduledValues(0);
|
||||
this._param.value = this._fromType(value);
|
||||
this.cancelScheduledValues(this.now());
|
||||
this.setValueAtTime(value, this.now());
|
||||
}
|
||||
|
||||
get minValue(): number {
|
||||
|
@ -188,12 +188,6 @@ implements AbstractParam<Type> {
|
|||
this.assert(isFinite(numericValue) && isFinite(computedTime),
|
||||
`Invalid argument(s) to setValueAtTime: ${JSON.stringify(value)}, ${JSON.stringify(time)}`);
|
||||
|
||||
const currentEvent = this._events.get(computedTime);
|
||||
// if there's already the same event, don't bother adding this one
|
||||
if (currentEvent && currentEvent.time === computedTime &&
|
||||
currentEvent.type === "setValue" && currentEvent.value === numericValue) {
|
||||
return this;
|
||||
}
|
||||
this.log(this.units, "setValue", value, computedTime);
|
||||
this._events.add({
|
||||
time: computedTime,
|
||||
|
|
Loading…
Reference in a new issue