Commit 7d61857
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 functions1 parent f23a696 commit 7d61857
3 files changed
Lines changed: 228 additions & 319 deletions
0 commit comments