Skip to content

Commit 2d31f05

Browse files
sedghifinetjul
authored andcommitted
feat: changed splitStringOnEnter function
1 parent 79bee32 commit 2d31f05

File tree

1 file changed

+8
-6
lines changed
  • Sources/Rendering/OpenGL/ImageMapper

1 file changed

+8
-6
lines changed

Sources/Rendering/OpenGL/ImageMapper/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ function computeFnToString(property, pwfun, numberOfComponents) {
3939

4040
function splitStringOnEnter(inputString) {
4141
// Split the input string into an array of lines based on "Enter" (newline) characters
42-
const lines = inputString.split('\n');
43-
4442
// Remove any leading or trailing whitespace from each line and filter out empty lines
45-
const trimmedLines = lines
46-
.map((line) => line.trim())
47-
.filter((line) => line.length > 0);
48-
43+
const lines = inputString.split('\n');
44+
const trimmedLines = [];
45+
for (let i = 0; i < lines.length; ++i) {
46+
const trimmedLine = lines[i].trim();
47+
if (trimmedLine.length > 0) {
48+
trimmedLines.push(trimmedLine);
49+
}
50+
}
4951
return trimmedLines;
5052
}
5153

0 commit comments

Comments
 (0)