Skip to content

Commit 3f9dd31

Browse files
SteveL-MSFTdkaszews
andcommitted
Update src/System.Management.Automation/namespaces/FileSystemProvider.cs
Co-authored-by: Dominik Kaszewski <[email protected]>
1 parent 37db1db commit 3f9dd31

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/System.Management.Automation/namespaces/FileSystemProvider.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3937,11 +3937,7 @@ private void CopyFileInfoItem(FileInfo file, string destinationPath, bool force,
39373937
StringUtil.Format(FileSystemProviderStrings.CopyingLocalFileActivity, _copiedFiles, _totalFiles),
39383938
StringUtil.Format(FileSystemProviderStrings.CopyingLocalBytesStatus, Utils.DisplayHumanReadableFileSize(_copiedBytes), Utils.DisplayHumanReadableFileSize(_totalBytes), speed)
39393939
);
3940-
var percentComplete = (int)((_copiedBytes * 100) / _totalBytes);
3941-
if (percentComplete > 100)
3942-
{
3943-
percentComplete = 100;
3944-
}
3940+
var percentComplete = (int) Math.Min(_copiedBytes * 100 / _totalBytes, 100);
39453941
progress.PercentComplete = percentComplete;
39463942
progress.RecordType = ProgressRecordType.Processing;
39473943
WriteProgress(progress);

0 commit comments

Comments
 (0)