Skip to content

Commit 4473aa9

Browse files
committed
Small refactor
1 parent 6b21c9a commit 4473aa9

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

Lib/profiling/sampling/live_collector/collector.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,23 +339,19 @@ def _update_display(self):
339339
self.display.refresh()
340340
return
341341

342+
# Setup colors and initialize widgets (needed for both help and normal display)
343+
colors = self._setup_colors()
344+
self._initialize_widgets(colors)
345+
342346
# Show help screen if requested
343347
if self.show_help:
344-
colors = self._setup_colors()
345-
self._initialize_widgets(colors)
346348
self._help_widget.render(0, width, height=height)
347349
self.display.refresh()
348350
return
349351

350352
# Prepare data
351353
elapsed, stats_list = self._prepare_display_data(height)
352354

353-
# Setup colors
354-
colors = self._setup_colors()
355-
356-
# Initialize widgets if needed
357-
self._initialize_widgets(colors)
358-
359355
# Render all sections
360356
self._render_display_sections(
361357
height, width, elapsed, stats_list, colors

0 commit comments

Comments
 (0)