File tree 3 files changed +10
-10
lines changed
protokt-runtime/src/main/kotlin/com/toasttab/protokt/rt
3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ class BytesSlice(
35
35
}
36
36
37
37
override fun equals (other : Any? ) =
38
- equalsUsingSequence(other, { length }) { asSequence() }
38
+ equalsUsingSequence(other, { it. length }) { it. asSequence() }
39
39
40
40
override fun hashCode () =
41
- hashCodeUsingSequence { asSequence() }
41
+ hashCodeUsingSequence( asSequence())
42
42
43
43
override fun toString () =
44
44
asSequence().joinToString(prefix = " [" , postfix = " ]" )
Original file line number Diff line number Diff line change @@ -47,12 +47,12 @@ fun <T> copyList(list: List<T>): List<T> =
47
47
48
48
internal inline fun <reified T > T.equalsUsingSequence (
49
49
other : Any? ,
50
- size : T .( ) -> Int ,
51
- asSequence : T .( ) -> Sequence <* >
50
+ size : ( T ) -> Int ,
51
+ asSequence : ( T ) -> Sequence <* >
52
52
) =
53
53
other is T &&
54
- size() == other. size() &&
55
- asSequence().zip(other. asSequence()).all { (l, r) -> l == r }
54
+ size(this ) == size(other ) &&
55
+ asSequence(this ).zip(asSequence(other )).all { (l, r) -> l == r }
56
56
57
- internal inline fun hashCodeUsingSequence (asSequence : () -> Sequence <* >) =
58
- asSequence() .fold(1 ) { hash, elt -> 31 * hash + elt.hashCode() }
57
+ internal fun hashCodeUsingSequence (asSequence : Sequence <* >) =
58
+ asSequence.fold(1 ) { hash, elt -> 31 * hash + elt.hashCode() }
Original file line number Diff line number Diff line change @@ -93,10 +93,10 @@ private constructor(
93
93
write(Tag ((fieldNumber shl 3 ) or wireType))
94
94
95
95
override fun equals (other : Any? ) =
96
- equalsUsingSequence(other, { size }) { asSequence() }
96
+ equalsUsingSequence(other, { it. size }) { it. asSequence() }
97
97
98
98
override fun hashCode () =
99
- hashCodeUsingSequence { asSequence() }
99
+ hashCodeUsingSequence( asSequence())
100
100
101
101
override fun toString (): String =
102
102
" Field(" +
You can’t perform that action at this time.
0 commit comments