File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,12 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Pro
51
51
else {
52
52
val newpd : this .type =
53
53
if (mySpan.isSynthetic) {
54
- if (! mySpan.exists && span.exists)
54
+ if (! mySpan.exists && span.exists) {
55
55
envelope(source, span.startPos) // fill in children spans
56
+ () // Note: the `()` is there to prevent some inefficient code from being generated.
57
+ // Without it we get an allocation of a span here since the result type of the `if`
58
+ // is `Any`, the lub of `Span` and `Unit`.
59
+ }
56
60
this
57
61
}
58
62
else cloneIn(source)
Original file line number Diff line number Diff line change @@ -570,7 +570,7 @@ object Names {
570
570
*/
571
571
def termName (cs : Array [Char ], offset : Int , len : Int ): SimpleName = synchronized {
572
572
util.Stats .record(" termName" )
573
- val h = hashValue(cs, offset, len) & (table.size - 1 )
573
+ val h = hashValue(cs, offset, len) & (table.length - 1 )
574
574
575
575
/** Make sure the capacity of the character array is at least `n` */
576
576
def ensureCapacity (n : Int ) =
You can’t perform that action at this time.
0 commit comments