@@ -50,7 +50,9 @@ public infix fun <T, C> Update<T, C>.perRowCol(expression: RowColumnExpression<T
50
50
public typealias UpdateExpression <T , C , R > = AddDataRow <T >.(C ) -> R
51
51
52
52
public infix fun <T , C > Update <T , C >.with (expression : UpdateExpression <T , C , C ?>): DataFrame <T > =
53
- withExpression(expression)
53
+ updateImpl { row, _, value ->
54
+ expression(row, value)
55
+ }
54
56
55
57
public fun <T , C > Update <T , C >.asNullable (): Update <T , C ?> = this as Update <T , C ?>
56
58
@@ -63,11 +65,6 @@ public fun <T, C> Update<T, C>.perCol(values: AnyRow): DataFrame<T> = perCol(val
63
65
public fun <T , C > Update <T , C >.perCol (valueSelector : Selector <DataColumn <C >, C >): DataFrame <T > =
64
66
updateWithValuePerColumnImpl(valueSelector)
65
67
66
- public fun <T , C > Update <T , C >.withExpression (expression : UpdateExpression <T , C , C ?>): DataFrame <T > =
67
- updateImpl { row, _, value ->
68
- expression(row, value)
69
- }
70
-
71
68
internal infix fun <T , C > RowValueFilter <T , C >?.and (other : RowValueFilter <T , C >): RowValueFilter <T , C > {
72
69
if (this == null ) return other
73
70
val thisExp = this
@@ -101,10 +98,10 @@ public fun <T> DataFrame<T>.update(
101
98
vararg cols : String ,
102
99
expression : RowValueExpression <T , Any ?, Any ?>
103
100
): DataFrame <T > =
104
- update(* headPlusArray(firstCol, cols)).withExpression (expression)
101
+ update(* headPlusArray(firstCol, cols)).with (expression)
105
102
106
103
public fun <T , C > Update <T , C >.withNull (): DataFrame <T > = asNullable().withValue(null )
107
104
108
105
public fun <T , C > Update <T , C >.withZero (): DataFrame <T > = updateWithValuePerColumnImpl { 0 as C }
109
106
110
- public infix fun <T , C > Update <T , C >.withValue (value : C ): DataFrame <T > = withExpression { value }
107
+ public infix fun <T , C > Update <T , C >.withValue (value : C ): DataFrame <T > = with { value }
0 commit comments