Skip to content

Commit 11b1934

Browse files
committed
Remove capacity and list.
1 parent 11a4d1b commit 11b1934

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Compiler/Facilities/prim-lexing.fs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,9 @@ type StringText(str: string) =
136136
line.Substring(range.StartColumn, length)
137137
else
138138
let firstLineContent = line.Substring(range.StartColumn)
139+
let sb = System.Text.StringBuilder().AppendLine(firstLineContent)
139140

140-
let capacity =
141-
[ (range.StartLine - 1) .. (range.EndLine - 1) ]
142-
|> List.sumBy (fun lineIdx -> (sourceText.GetLineString lineIdx).Length)
143-
144-
let sb = System.Text.StringBuilder(capacity).AppendLine(firstLineContent)
145-
146-
for lineNumber in [ range.StartLine .. range.EndLine - 2 ] do
141+
for lineNumber in range.StartLine .. range.EndLine - 2 do
147142
sb.AppendLine(sourceText.GetLineString lineNumber) |> ignore
148143

149144
let lastLine = sourceText.GetLineString(range.EndLine - 1)

0 commit comments

Comments
 (0)