Skip to content

Commit

Permalink
add perf comment
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Oct 18, 2023
1 parent 80f0a4b commit feb2bd0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/compose/preprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ impl Preprocessor {
open_count += line.match_indices('{').count();
open_count = open_count.saturating_sub(line.match_indices('}').count());

// TODO: it's bad that we allocate here. ideally we would use something like
// let import_lines = &shader_str[initial_offset..offset]
// but we need the comments removed, and the iterator approach doesn't make that easy
import_lines.push_str(&line);
import_lines.push('\n');

Expand Down Expand Up @@ -410,6 +413,9 @@ impl Preprocessor {
open_count += line.match_indices('{').count();
open_count = open_count.saturating_sub(line.match_indices('}').count());

// TODO: it's bad that we allocate here. ideally we would use something like
// let import_lines = &shader_str[initial_offset..offset]
// but we need the comments removed, and the iterator approach doesn't make that easy
import_lines.push_str(&line);
import_lines.push('\n');

Expand Down

0 comments on commit feb2bd0

Please sign in to comment.