Here are some suggestions −
Use lists when necessary. Doing the same job using an ArrayList may make the code work slower. Especially when you store multiple types of objects in the same list.
It is better to use multiplicative shift operations than division operators because using division operators will make the code slower.
Try using operators to concise your code and make it work in one line.
Using operators like &&, all conditions can be mentioned in one line.
The above is the detailed content of Optimization tips for C# code. For more information, please follow other related articles on the PHP Chinese website!