Unverified Commit 722b4277 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Provide a non-null default value for the compute debug label in release mode (#49638)

parent e7984bd4
......@@ -12,9 +12,7 @@ import 'isolates.dart' as isolates;
/// The dart:io implementation of [isolate.compute].
Future<R> compute<Q, R>(isolates.ComputeCallback<Q, R> callback, Q message, { String debugLabel }) async {
if (!kReleaseMode) {
debugLabel ??= callback.toString();
}
debugLabel ??= kReleaseMode ? 'compute' : callback.toString();
final Flow flow = Flow.begin();
Timeline.startSync('$debugLabel: start', flow: flow);
final ReceivePort resultPort = ReceivePort();
......@@ -80,7 +78,7 @@ class _IsolateConfiguration<Q, R> {
Future<void> _spawn<Q, R>(_IsolateConfiguration<Q, FutureOr<R>> configuration) async {
R result;
await Timeline.timeSync(
'${configuration.debugLabel}',
configuration.debugLabel,
() async {
final FutureOr<R> applicationResult = await configuration.apply();
result = await applicationResult;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment