docs icon indicating copy to clipboard operation
docs copied to clipboard

fix: optimize find command for better performance

Open 0xwitty opened this issue 8 months ago • 1 comments

I noticed that the find command in the script was using -exec twice, which can be optimized. I replaced it with a single -exec using + to improve performance. Additionally, I cleaned up the backup file removal by using a separate find command.

Here's the updated code:

find "$TYPEDOC_OUTPUT_DIR" -type f -name "*.md" -exec \
  sed -i.bak -E 's/\\+//g' {} + && find "$TYPEDOC_OUTPUT_DIR" -type f -name "*.md.bak" -delete

This change should make the script more efficient while maintaining the same functionality.

0xwitty avatar Feb 16 '25 16:02 0xwitty