Ticket #1951 (new enhancement) — at Version 4
Simplify
| Reported by: | pavlinux | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | mc-core | Version: | master |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Branch state: | no branch | Votes for changeset: |
Description (last modified by styx) (diff)
(x + 1) * 2 = ++x << 1
Change History
Note: See
TracTickets for help on using
tickets.

Code for test
#include <stdio.h> int main(void) { int sp = 0; int dp = 0; while ( sp < 0xFF /* just limit */ ) { sp = (++sp << 1); dp = 2 * ( dp + 1 ); printf("%d = %d\n", sp, dp); } return 0; }