mdedetrich commented on code in PR #2251:
URL: https://github.com/apache/pekko/pull/2251#discussion_r2366188771


##########
stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala:
##########
@@ -60,7 +60,7 @@ import org.reactivestreams.Subscriber
  */
 @InternalApi private[pekko] object PhasedFusingActorMaterializer {
 
-  val Debug = false
+  final val Debug = false

Review Comment:
   > by making it a val , then it's a compiler constant, then the if branch 
will be purged by the comipler。
   >  
   
   Indeed this is correct, it will be constant folded because compiler knows it 
can't be overridden.



##########
stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala:
##########
@@ -60,7 +60,7 @@ import org.reactivestreams.Subscriber
  */
 @InternalApi private[pekko] object PhasedFusingActorMaterializer {
 
-  val Debug = false
+  final val Debug = false

Review Comment:
   > by making it a val , then it's a compiler constant, then the if branch 
will be purged by the comipler。
   >  
   
   Indeed this is correct, it will be constant folded because compiler knows it 
can't be overridden.
   
   https://stackoverflow.com/a/24911844



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to