Update cpp.md

Signed-off-by: Dennis Eichhorn <spl1nes.com@googlemail.com>
This commit is contained in:
Dennis Eichhorn 2024-08-05 19:36:12 +02:00 committed by GitHub
parent 20a754151b
commit 0910172c26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,9 +42,9 @@ Branched code
```c++ ```c++
for (int i = 0; i < N; i++) for (int i = 0; i < N; i++)
if (a[i] < 50) { if (a[i] < 50) {
s += a[i]; s += a[i];
} }
} }
``` ```
@ -53,7 +53,7 @@ Branchless code
```c++ ```c++
for (int i = 0; i < N; i++) for (int i = 0; i < N; i++)
s += (a[i] < 50) * a[i]; s += (a[i] < 50) * a[i];
} }
``` ```