fix: minor correctness and performance bugs#553
Conversation
- RTKBaseConfigManager.expand_path(): replace str.strip() with str.removeprefix() for $BASEDIR substitution. strip() removes any character in the set from both ends, not just the prefix, which can silently corrupt paths containing those characters. - LogManager.updateAvailableLogs(): move sort() call outside the for loop. Sorting on every append is O(n² log n); with many log files on a Raspberry Pi this is measurably slow. - network_infos.get_interfaces_infos(): merge two nmcli.device.show() calls per interface into one, halving the number of subprocess forks when displaying network info in the settings page. - server.update_settings(): guard against empty json_msg before pop() to prevent an uncaught IndexError that would silently kill the socket handler under malformed client input. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
What this PR fixesFour correctness and performance bugs found by static code review. None cause crashes, but two produce silently wrong results. 1.
|
No description provided.