You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dependent on #5096, this diff switches from "new PartialFunction" or "extends PartialFunction" on concrete classes to make use of AbstractPartialFunction, trimming a modest amount of classfile space.
The text was updated successfully, but these errors were encountered:
Commit Message Bot (anonymous) said:
(extempore in r25854) AbstractPartialFunction.
Contributed by Todd Vierling with minor mods by extempore. This is an
obvious extension of AbstractFunctionN which I had some issue making
work at the time. Sounds kind of pitiful given that the compiler patch
is about two lines, but let's all agree to believe it was a different
world then.
This example program is impacted as follows:
class A {
def f: PartialFunction[Any, Int] = { case x: String => 1 }
def g: PartialFunction[Any, Int] = f orElse { case x: List[_] => 2 }
def h: PartialFunction[Any, Int] = g orElse { case x: Set[_] => 3 }
}
Before: 34943 bytes of bytecode
After: 4217 bytes of bytecode
A mere 88% reduction in size. "'Tis but a trifle!" Closes #5096, #5097.
Dependent on #5096, this diff switches from "new PartialFunction" or "extends PartialFunction" on concrete classes to make use of AbstractPartialFunction, trimming a modest amount of classfile space.
The text was updated successfully, but these errors were encountered: