Skip to content

Commit 7d61857

Browse files
committed
Refactor duplicated code in callback handling
- Merge create_suspended_state() and create_suspended_state_from_existing() into a unified create_suspended_state_ex() with source parameter - Add cleanup_suspended_state_partial() helper for consistent error cleanup - Extract build_pending_callback_exc_args() to build exc_args tuple from thread-local pending callback state (eliminates ~50 lines of duplicated code across 4 call sites) - Extract build_suspended_result() to build the {suspended, ...} result term from a suspended state - Remove now-unused make_suspended_term() function - Add forward declarations in py_nif.c for cross-module helper functions
1 parent f23a696 commit 7d61857

3 files changed

Lines changed: 228 additions & 319 deletions

File tree

0 commit comments

Comments
 (0)