Skip to content

Commit f79e38a

Browse files
authored
Update ConvertTo-SourceLineNumber.ps1
Changed line 61 instead of 76 due to cleaner coding and accomplishing the same
1 parent 8dc830e commit f79e38a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/Public/ConvertTo-SourceLineNumber.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function ConvertTo-SourceLineNumber {
5858
[PSCustomObject]@{
5959
PSTypeName = "BuildSourceMapping"
6060
SourceFile = $_.Matches[0].Groups["SourceFile"].Value.Trim("'")
61-
StartLineNumber = $_.LineNumber
61+
StartLineNumber = [System.Int32] $_.LineNumber
6262
# This offset is added when calculating the line number
6363
# because of the new line we're adding prior to the content
6464
# of each script file in the built module.
@@ -73,7 +73,7 @@ function ConvertTo-SourceLineNumber {
7373
# We need the match *before* the line we're searching for
7474
# And we need it as a zero-based index:
7575
# Cast $SourceLineNumber to the type of the first item in $hit.StartLineNumber
76-
$index = -2 - [Array]::BinarySearch($hit.StartLineNumber, $($SourceLineNumber -as $hit.StartLineNumber[0].GetType()) )
76+
$index = -2 - [Array]::BinarySearch($hit.StartLineNumber, $SourceLineNumber )
7777
$Source = $hit[$index]
7878

7979
if($Passthru) {

0 commit comments

Comments
 (0)