fix incorrect starting value for optimized allocations in a loop

This commit is contained in:
Jaden Weiss
2019-11-13 10:05:01 -05:00
committed by Ayke
parent acdaaa17d8
commit 93961f9d41
4 changed files with 36 additions and 2 deletions
+3 -2
View File
@@ -70,8 +70,9 @@ func fuzzyEqualIR(s1, s2 string) bool {
func filterIrrelevantIRLines(lines []string) []string {
var out []string
for _, line := range lines {
line = strings.TrimSpace(line) // drop '\r' on Windows
if line == "" || line[0] == ';' {
line = strings.Split(line, ";")[0] // strip out comments/info
line = strings.TrimRight(line, "\r ") // drop '\r' on Windows and remove trailing spaces from comments
if line == "" {
continue
}
if strings.HasPrefix(line, "source_filename = ") {