From 4461cfbaafaa71b5323ebbdb66cd202da3b8acc2 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 10 Jun 2020 12:15:04 -0700 Subject: [PATCH] Drop an unnecessary factory constructor (#58723) --- .../lib/src/driver/timeline.dart | 44 +++++++------------ 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/packages/flutter_driver/lib/src/driver/timeline.dart b/packages/flutter_driver/lib/src/driver/timeline.dart index d8ab1339d10..4bf68c4a94c 100644 --- a/packages/flutter_driver/lib/src/driver/timeline.dart +++ b/packages/flutter_driver/lib/src/driver/timeline.dart @@ -26,35 +26,21 @@ class Timeline { /// A single timeline event. class TimelineEvent { /// Creates a timeline event given JSON-encoded event data. - factory TimelineEvent(Map json) { - return TimelineEvent._( - json, - json['name'] as String, - json['cat'] as String, - json['ph'] as String, - json['pid'] as int, - json['tid'] as int, - json['dur'] != null ? Duration(microseconds: json['dur'] as int) : null, - json['tdur'] != null ? Duration(microseconds: json['tdur'] as int) : null, - json['ts'] as int, - json['tts'] as int, - json['args'] as Map, - ); - } - - TimelineEvent._( - this.json, - this.name, - this.category, - this.phase, - this.processId, - this.threadId, - this.duration, - this.threadDuration, - this.timestampMicros, - this.threadTimestampMicros, - this.arguments, - ); + TimelineEvent(this.json) + : name = json['name'] as String, + category = json['cat'] as String, + phase = json['ph'] as String, + processId = json['pid'] as int, + threadId = json['tid'] as int, + duration = json['dur'] != null + ? Duration(microseconds: json['dur'] as int) + : null, + threadDuration = json['tdur'] != null + ? Duration(microseconds: json['tdur'] as int) + : null, + timestampMicros = json['ts'] as int, + threadTimestampMicros = json['tts'] as int, + arguments = json['args'] as Map; /// The original event JSON. final Map json;