invalidateCachedStatistics method

void invalidateCachedStatistics(
  1. String? statType
)

Remove the cached statistics synchronously

For asynchronous version, see invalidateCachedStatisticsAsync.

If statType is null, all statistic caches are deleted, otherwise only the specified cache is deleted.

Implementation

void invalidateCachedStatistics(String? statType) {
  try {
    if (statType != null) {
      (_access.stats >>> '$statType.cache').deleteSync();
    } else {
      (_access.stats >>> 'length.cache').deleteSync();
      (_access.stats >>> 'size.cache').deleteSync();
    }
    // ignore: empty_catches
  } catch (e) {}
}