1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v: add compiler support for _unlikely_(x) too

This commit is contained in:
Delyan Angelov
2020-06-09 18:08:31 +03:00
parent c7d4360931
commit 4fc41c4bc4
9 changed files with 42 additions and 13 deletions

View File

@@ -1700,6 +1700,9 @@ boolean expression is very likely to be true, so it can generate assembly
code, with less chance of branch misprediction. In the JS backend,
that does nothing.
`if _unlikely_(bool expression) {` similar to `_likely_(x)`, but it hints that
the boolean expression is highly improbable. In the JS backend, that does nothing.
## Reflection via codegen
Having built-in JSON support is nice, but V also allows you to create efficient