You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: only use reflection in FileSystemWatcherMock when simulating other OS (#871)
This PR refactors the `FileSystemWatcherMock` class to optimize performance by conditionally using reflection only when simulating non-native operating systems, rather than always using reflection for path manipulation.
### Key Changes
- Conditional reflection usage based on simulation mode to improve performance in native scenarios
- Updated constructor parameters to use the `Path` property instead of local variables
// FileSystemEventArgs implicitly combines the path in https://github.com/dotnet/runtime/blob/v8.0.4/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
517
-
// HACK: Have to resort to Reflection to override this behavior!
// FileSystemEventArgs implicitly combines the path in https://github.com/dotnet/runtime/blob/v8.0.4/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
519
+
// HACK: Have to resort to Reflection to override this behavior!
// RenamedEventArgs implicitly combines the path in https://github.com/dotnet/runtime/blob/v8.0.4/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/RenamedEventArgs.cs
625
-
// HACK: Have to resort to Reflection to override this behavior!
// RenamedEventArgs implicitly combines the path in https://github.com/dotnet/runtime/blob/v8.0.4/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/RenamedEventArgs.cs
631
+
// HACK: Have to resort to Reflection to override this behavior!
0 commit comments