Skip to content

Commit 28739e4

Browse files
author
Samuel Rigaud
committed
AsciiEffect: avoid useless split operations
1 parent fe2a12c commit 28739e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/jsm/effects/AsciiEffect.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ class AsciiEffect {
118118
}
119119

120120

121-
const aDefaultCharList = ( ' .,:;i1tfLCG08@' ).split( '' );
122-
const aDefaultColorCharList = ( ' CGO08@' ).split( '' );
123121
const strFont = 'courier new, monospace';
124122

125123
const oCanvasImg = renderer.domElement;
@@ -138,9 +136,11 @@ class AsciiEffect {
138136

139137
}
140138

139+
const aDefaultCharList = ( ' .,:;i1tfLCG08@' ).split( '' );
140+
const aDefaultColorCharList = ( ' CGO08@' ).split( '' );
141141
let aCharList = ( bColor ? aDefaultColorCharList : aDefaultCharList );
142142

143-
if ( charSet ) aCharList = charSet;
143+
if ( charSet ) aCharList = ( charSet ).split( '' );
144144

145145
// Setup dom
146146

0 commit comments

Comments
 (0)