[Github-comments] [geany/geany] Fix rstrip-whitespace.py (#2897)

Doug Henderson notifications at xxxxx
Thu Sep 16 04:24:36 UTC 2021


The [rstrip-whitespace.py](https://github.com/geany/geany/blob/master/scripts/rstrip-whitespace.py) script contains redundant code.

This script performed the operation of applying [rstrip()](https://docs.python.org/3/library/stdtypes.html#str.rstrip) to all lines in a file three consecutive times. This a case of belt, suspenders and a safety pin. Only one such operation is required. Let's pick one possibly dependent on the size of the input file.

I suggest using [timeit ](https://docs.python.org/3/library/timeit.html)to determine which method has the best performance and under what circumstance each may be required in order to perform successfully for files up to some maximum size.

The aforementioned maximum size needs to be established.

I am willing to offer a patch.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2897
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20210915/56c1b64d/attachment.htm>


More information about the Github-comments mailing list