From a754f372094636eabafd4b945e059a7bb2d78e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Sat, 8 Sep 2018 18:02:59 +0200 Subject: [PATCH] fix conditions in Buffer.setBufferLineFactory --- src/Buffer.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Buffer.ts b/src/Buffer.ts index ae4619b0..ee982564 100644 --- a/src/Buffer.ts +++ b/src/Buffer.ts @@ -55,14 +55,16 @@ export class Buffer implements IBuffer { } public setBufferLineFactory(type: string): void { - if (type === 'JsArray' && this._bufferLineConstructor !== BufferLine) { - this._bufferLineConstructor = BufferLine; - this._recreateLines(); - } else if (type === 'TypedArray' && this._bufferLineConstructor !== BufferLineTypedArray) { - this._bufferLineConstructor = BufferLineTypedArray; - this._recreateLines(); + if (type === 'TypedArray') { + if (this._bufferLineConstructor !== BufferLineTypedArray) { + this._bufferLineConstructor = BufferLineTypedArray; + this._recreateLines(); + } } else { - this._bufferLineConstructor = BufferLine; + if (this._bufferLineConstructor !== BufferLine) { + this._bufferLineConstructor = BufferLine; + this._recreateLines(); + } } }