File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,11 @@ object Scanners {
126
126
127
127
// Setting token data ----------------------------------------------------
128
128
129
+ protected def initialCharBufferSize = 1024
130
+
129
131
/** A character buffer for literals
130
132
*/
131
- protected val litBuf = CharBuffer ()
133
+ protected val litBuf = CharBuffer (initialCharBufferSize )
132
134
133
135
/** append Unicode character to "litBuf" buffer
134
136
*/
@@ -242,7 +244,7 @@ object Scanners {
242
244
def getDocComment (pos : Int ): Option [Comment ] = docstringMap.get(pos)
243
245
244
246
/** A buffer for comments */
245
- private val commentBuf = CharBuffer ()
247
+ private val commentBuf = CharBuffer (initialCharBufferSize )
246
248
247
249
def toToken (identifier : SimpleName ): Token =
248
250
def handleMigration (keyword : Token ): Token =
@@ -1076,6 +1078,7 @@ object Scanners {
1076
1078
next
1077
1079
1078
1080
class LookaheadScanner (val allowIndent : Boolean = false ) extends Scanner (source, offset, allowIndent = allowIndent) {
1081
+ override protected def initialCharBufferSize = 8
1079
1082
override def languageImportContext = Scanner .this .languageImportContext
1080
1083
}
1081
1084
You can’t perform that action at this time.
0 commit comments