krzema12 / kotlin-python

Python target for the Kotlin Programming Language. See https://github.com/krzema12/kotlin-python/tree/python-backend/python
https://discuss.kotlinlang.org/t/idea-python-backend/19852
47 stars 1 forks source link

[#94] Remove unreferenced code #96

Closed krzema12 closed 2 years ago

krzema12 commented 2 years ago

Anything that was marked as unused in IntelliJ was removed. The analysis was very shallow, and didn't check e.g. if actually a lowering is used. It's in scope of the next changes.

The only exceptions are some entities which symbols are not used in compile time, but they are somehow used in runtime. Each such occurrence was marked with a comment.

Reduced code size by ~6.5%.

Before (using cloc):

-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Kotlin                          97           2704           1034          11985

After:

-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Kotlin                          95           2557           1010          11237