Skip to content

Commit 2b58780

Browse files
Merge pull request #3316 from dotty-staging/inline-deep
Inline deep
2 parents 91b874b + 552dbcf commit 2b58780

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.jvmopts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
-Xss1m
22
-Xms512m
33
-Xmx1200m
4+
-XX:MaxInlineLevel=35

compiler/src/dotty/tools/dotc/core/tasty/TastyBuffer.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import util.Util.dble
88
object TastyBuffer {
99

1010
/** The number of digits of the natural number `nat`, written in base 128 format. */
11-
def natSize(nat: Int): Int =
12-
if (nat < 128) 1 else natSize(nat >>> 7) + 1
11+
def natSize(nat: Int): Int = {
12+
def loop(n: Int, acc: Int): Int =
13+
if (n < 128) acc else loop(n >>> 7, acc + 1)
14+
loop(nat, 1)
15+
}
1316

1417
/** An address pointing to an index in a Tasty buffer's byte array */
1518
case class Addr(index: Int) extends AnyVal {

0 commit comments

Comments
 (0)