Remove dead variables in make_ptc_api_call - #6
Conversation
auth_header and additional_curl_params were assembled as quoted strings but never read — each curl invocation inlines its own -H/-F. Drop both, keeping the debug/warning log lines they were interleaved with so output is unchanged.
|
Merged — thank you, and sorry it sat here for two weeks. I verified the claim independently rather than taking it on trust, and it holds exactly as described: Worth naming the part your summary undersold: Also appreciated: keeping the interleaved logging while deleting the assignments, and rewriting the comment to say what the code now does instead of leaving it describing the removed variable. That is the part these cleanups usually get wrong. |
Summary. Delete two local variables that were assembled but never read.
Problem.
auth_headerandadditional_curl_paramswere built as quoted strings (-H "…",-F "…") but nothing consumed them — eachcurlcall inlines its own headers and form fields. The code reads as if auth flows through a variable when it doesn't.Change. Remove the four
auth_header/additional_curl_paramsassignments; keep every interleaved log line (Using API token…,No API token provided…,Including additional_translation_files…) and refresh the stale comment, so output is unchanged.Risk. None — the variables had no readers; curl behaviour is byte-identical.
Verified.
grepshows zero remaining references;test-runner(12) andtest-error-shapes(22, exercises the upload/process path) green. Independent review confirmed truly dead, no log lines dropped.