Type RandomAccessFile in io_resource_info to avoid dynamic invocation of path

There's one only one path for creating a _FileResourceInfo which comes from RandomAccessFile. Type the `file` field to avoid a dynamic call to `.path`.

Change-Id: Ia1041d5b221d0496af3dd177562263b31cdf4157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259106
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
This commit is contained in:
Kallen Tu 2022-09-15 20:55:39 +00:00 committed by Commit Bot
parent 822ae59aca
commit af20d93e56
2 changed files with 1 additions and 2 deletions

View file

@ -39,7 +39,6 @@
"Dynamic invocation of '[]='.": 1
},
"org-dartlang-sdk:///lib/io/io_resource_info.dart": {
"Dynamic access of 'path'.": 1,
"Dynamic access of 'dart.io::_path'.": 1,
"Dynamic access of 'pid'.": 1,
"Dynamic access of 'dart.io::_arguments'.": 1,

View file

@ -88,7 +88,7 @@ abstract class _ReadWriteResourceInfo extends _IOResourceInfo {
class _FileResourceInfo extends _ReadWriteResourceInfo {
static const String _type = 'OpenFile';
final file;
final RandomAccessFile file;
static Map<int, _FileResourceInfo> openFiles = {};