Skip to content

Commit 41eb04a

Browse files
Carried character limit to final val
1 parent f3829d1 commit 41eb04a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/core/NameOps.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ object NameOps {
1313
object compactify {
1414
lazy val md5: MessageDigest = MessageDigest.getInstance("MD5")
1515

16+
final val CHAR_LIMIT = 240
17+
1618
/** COMPACTIFY
1719
*
1820
* The hashed name has the form (prefix + marker + md5 + marker + suffix), where
@@ -28,8 +30,7 @@ object NameOps {
2830
def apply(s: String): String = {
2931
val marker = "$$$$"
3032

31-
val charLimit: Int = 240
32-
val MaxNameLength = (charLimit - 6) min 2 * (charLimit - 6 - 2 * marker.length - 32)
33+
val MaxNameLength = (CHAR_LIMIT - 6) min 2 * (CHAR_LIMIT - 6 - 2 * marker.length - 32)
3334

3435
def toMD5(s: String, edge: Int): String = {
3536
val prefix = s take edge

0 commit comments

Comments
 (0)