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 @@ -128,9 +128,11 @@ object Scanners {
128
128
129
129
// Setting token data ----------------------------------------------------
130
130
131
+ protected def initialCharBufferSize = 1024
132
+
131
133
/** A character buffer for literals
132
134
*/
133
- protected val litBuf = CharBuffer ()
135
+ protected val litBuf = CharBuffer (initialCharBufferSize )
134
136
135
137
/** append Unicode character to "litBuf" buffer
136
138
*/
@@ -244,7 +246,7 @@ object Scanners {
244
246
def getDocComment (pos : Int ): Option [Comment ] = docstringMap.get(pos)
245
247
246
248
/** A buffer for comments */
247
- private val commentBuf = CharBuffer ()
249
+ private val commentBuf = CharBuffer (initialCharBufferSize )
248
250
249
251
def toToken (identifier : SimpleName ): Token =
250
252
def handleMigration (keyword : Token ): Token =
@@ -1079,6 +1081,7 @@ object Scanners {
1079
1081
next
1080
1082
1081
1083
class LookaheadScanner (val allowIndent : Boolean = false ) extends Scanner (source, offset, allowIndent = allowIndent) {
1084
+ override protected def initialCharBufferSize = 8
1082
1085
override def languageImportContext = Scanner .this .languageImportContext
1083
1086
}
1084
1087
You can’t perform that action at this time.
0 commit comments