(n int)
| 537 | } |
| 538 | |
| 539 | func prefixEncodeCode(n int) (int, int) { |
| 540 | if n <= 5 { |
| 541 | return max(0, n - 1), 0 |
| 542 | } |
| 543 | |
| 544 | shift := 0 |
| 545 | rem := n - 1 |
| 546 | for rem > 3 { |
| 547 | rem >>= 1 |
| 548 | shift += 1 |
| 549 | } |
| 550 | |
| 551 | if rem == 2 { |
| 552 | return 2 + 2 * shift, n - (2 << shift) - 1 |
| 553 | } |
| 554 | |
| 555 | return 3 + 2 * shift, n - (3 << shift) - 1 |
| 556 | } |
| 557 | |
| 558 | func prefixEncodeBits(prefix int) int { |
| 559 | if prefix < 4 { |
no outgoing calls
searching dependent graphs…