Commit 9f64d75
authored
[Support] Simplify the continuation condition in encodeSLEB128 (NFC) (llvm#165651)
The boolean expression to determine if more bytes are needed for a
signed LEB128 value is quite complex:
!((((Value == 0 ) && ((Byte & 0x40) == 0)) ||
((Value == -1) && ((Byte & 0x40) != 0))))
This patch simplifies it to an equivalent expression using a ternary
operator, which is much easier to understand.1 parent 546e91b commit 9f64d75
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
62 | | - | |
| 60 | + | |
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
| |||
0 commit comments