-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Only show char codes for parsing data on trace #5425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2c57b32
c3bb36b
09e2698
59241e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -444,12 +444,11 @@ export class InputHandler extends Disposable implements IInputHandler { | |
| } | ||
|
|
||
| // Log debug data, the log level gate is to prevent extra work in this hot path | ||
| if (this._logService.logLevel <= LogLevelEnum.DEBUG) { | ||
| this._logService.debug(`parsing data${typeof data === 'string' ? ` "${data}"` : ` "${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}"`}`, typeof data === 'string' | ||
| ? data.split('').map(e => e.charCodeAt(0)) | ||
| : data | ||
| ); | ||
| } | ||
| this._logService.debug(`parsing data ${typeof data === 'string' ? ` "${data}"` : ` "${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}"`}`); | ||
| this._logService.trace(`parsing data (codes)`, () => typeof data === 'string' | ||
| ? data.split('').map(e => e.charCodeAt(0)) | ||
| : Array.from(data) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't need Array.from before?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Facts!! You're right.. data is Uint8Array, doing Array.from(data) feels like complete waste. |
||
| ); | ||
|
|
||
| // resize input buffer if needed | ||
| if (this._parseBuffer.length < data.length) { | ||
|
|
@@ -606,7 +605,7 @@ export class InputHandler extends Disposable implements IInputHandler { | |
| // since an empty cell is only set by fullwidth chars | ||
| bufferRow.addCodepointToCell(this._activeBuffer.x - offset, | ||
| code, chWidth); | ||
| for (let delta = chWidth - oldWidth; --delta >= 0; ) { | ||
| for (let delta = chWidth - oldWidth; --delta >= 0;) { | ||
| bufferRow.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, curAttr); | ||
| } | ||
| continue; | ||
|
|
@@ -1622,7 +1621,7 @@ export class InputHandler extends Disposable implements IInputHandler { | |
| const text = bufferRow.getString(x); | ||
| const data = new Uint32Array(text.length * length); | ||
| let idata = 0; | ||
| for (let itext = 0; itext < text.length; ) { | ||
| for (let itext = 0; itext < text.length;) { | ||
| const ch = text.codePointAt(itext) || 0; | ||
| data[idata++] = ch; | ||
| itext += ch > 0xffff ? 2 : 1; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.