We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Efficient code is code that generates the least amount of machine instructions or unrolls loops not what looks efficient in higher level language. Take both samples of code and compile them and then look at the assembly generated. When you write code with a lot of nested ternary operators the compiler cannot perform its optimizations correctly. So,
Functions
You are viewing a single comment's thread. Return to all comments →
Efficient code is code that generates the least amount of machine instructions or unrolls loops not what looks efficient in higher level language. Take both samples of code and compile them and then look at the assembly generated. When you write code with a lot of nested ternary operators the compiler cannot perform its optimizations correctly. So,
will optimize better than