We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17510d9 commit 470416dCopy full SHA for 470416d
1 file changed
Engine/Extensions.cs
@@ -1,6 +1,6 @@
1
using System;
2
using System.Collections.Generic;
3
-using System.IO;
+using System.Linq;
4
using System.Management.Automation.Language;
5
6
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Extensions
@@ -10,17 +10,7 @@ public static class Extensions
10
{
11
public static IEnumerable<string> GetLines(this string text)
12
13
- var lines = new List<string>();
14
- using (var stringReader = new StringReader(text))
15
- {
16
- string line;
17
- line = stringReader.ReadLine();
18
- while (line != null)
19
20
- yield return line;
21
22
- }
23
+ return text.Split('\n').Select(line => line.TrimEnd('\r'));
24
}
25
26
public static IScriptExtent Translate(this IScriptExtent extent, int lineDelta, int columnDelta)
0 commit comments