Effect of unused methods and properties on library or executable

前端 未结 3 743
广开言路
广开言路 2021-01-18 20:51

I\'m playing around with creating a source code generator for C# (.NET). Will generating properties or methods that never get called cause my code to run slower? How about i

3条回答
  •  有刺的猬
    2021-01-18 21:22

    You should consider using partial methods, especially when using code generators. A partial method, if it's not actually implemented, will be removed by the compiler.

提交回复
热议问题