Skip to content

Commit 4a1c9f2

Browse files
inline mapNull to avoid creating closures
Co-authored-by: Nicolas Stucki <[email protected]>
1 parent b2d1190 commit 4a1c9f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/scala/IArray.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ object IArray:
329329
def +:(arr: IArray[U]): IArray[U] = genericArrayOps(arr).prepended(x)
330330

331331
// For backwards compatibility with code compiled without -Yexplicit-nulls
332-
private def mapNull[A, B](a: A, f: =>B): B =
332+
private inline def mapNull[A, B](a: A, inline f: B): B =
333333
if((a: A|Null) == null) null.asInstanceOf[B] else f
334334

335335
/** Conversion from IArray to immutable.ArraySeq */

0 commit comments

Comments
 (0)