Skip to content

Commit

Permalink
Cleanup vars (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahsmartin authored Dec 13, 2023
1 parent 5197659 commit 3b4cad1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ETTrace/ETTraceRunner/RunnerHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,23 @@ class RunnerHelper {
symbolicator: symbolicator)
let outputUrl = URL(fileURLWithPath: FileManager.default.currentDirectoryPath)

var allThreads:[Flamegraph] = []
var mainThreadFlamegraph: Flamegraph!
var mainThreadData: Data!
var mainThreadData: Data?
for (threadId, symbolicationResult) in zip(threadIds, flamegraphs) {
let thread = responseData.threads[threadId]!
let flamegraph = createFlamegraphForThread(symbolicationResult.0, symbolicationResult.1, thread, responseData)
allThreads.append(flamegraph)

let outJsonData = JSONWrapper.toData(flamegraph)!

if thread.name == "Main Thread" {
if verbose {
try symbolicationResult.2.write(toFile: "output.folded", atomically: true, encoding: .utf8)
}
mainThreadFlamegraph = flamegraph
mainThreadData = outJsonData
}
try saveFlamegraph(outJsonData, outputUrl, threadId)
}

guard mainThreadFlamegraph != nil else {
guard let mainThreadData else {
fatalError("No main thread flamegraphs generated")
}

Expand Down

0 comments on commit 3b4cad1

Please sign in to comment.