Code Cleanup

This commit is contained in:
ema
2025-05-25 03:45:07 +08:00
parent 51a46155d7
commit eed0c53e9c
4 changed files with 8 additions and 8 deletions

View File

@@ -99,7 +99,7 @@ public class TextViewerPanel : TextEditor, IDisposable
e.TranslationBehavior = new InertiaTranslationBehavior
{
InitialVelocity = e.InitialVelocities.LinearVelocity,
DesiredDeceleration = 10.0 * 96.0 / (1000.0 * 1000.0)
DesiredDeceleration = 10d * 96d / (1000d * 1000d)
};
}
@@ -148,10 +148,10 @@ public class TextViewerPanel : TextEditor, IDisposable
private void LoadFileAsync(string path)
{
Task.Run(() =>
_ = Task.Run(() =>
{
const int maxLength = 5 * 1024 * 1024;
const int maxHighlightingLength = (int)(0.5 * 1024 * 1024);
const int maxHighlightingLength = (int)(0.5d * 1024 * 1024);
var buffer = new MemoryStream();
bool fileTooLong;
@@ -187,7 +187,7 @@ public class TextViewerPanel : TextEditor, IDisposable
if (_disposed)
return;
Dispatcher.BeginInvoke(new Action(() =>
Dispatcher.BeginInvoke(() =>
{
Encoding = encoding;
SyntaxHighlighting = bufferCopy.Length > maxHighlightingLength
@@ -196,7 +196,7 @@ public class TextViewerPanel : TextEditor, IDisposable
Document = doc;
_context.IsBusy = false;
}), DispatcherPriority.Render);
}, DispatcherPriority.Render);
});
}
}