Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdgr8 committed Jan 19, 2024
1 parent e5715db commit 2b59dcd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,15 @@ class DelegatedClassTest {
private class MyNSObject(val value: Int) : NSObject() {

override fun isEqual(`object`: Any?): Boolean {
if (`object` === this) {
return true
}
if (`object` is MyNSObject && `object`.value == value) {
return true
}
return false
if (`object` === this) return true
if (`object` !is MyNSObject) return false
return value == `object`.value
}

override fun hash(): NSUInteger {
return value.convert()
}
override fun hash(): NSUInteger = value.convert()

override fun description(): String {
return "My value is $value"
}
override fun description(): String =
"My value is $value"
}

private class MyDelegatedObject(actual: MyNSObject) : DelegatedClass<MyNSObject>(actual)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,15 @@ class DelegatedClassTest {
private class MyObject(val value: Int) {

override fun equals(other: Any?): Boolean {
if (other === this) {
return true
}
if (other is MyObject && other.value == value) {
return true
}
return false
if (other === this) return true
if (other !is MyObject) return false
return value == other.value
}

override fun hashCode(): Int {
return value
}
override fun hashCode(): Int = value

override fun toString(): String {
return "My value is $value"
}
override fun toString(): String =
"My value is $value"
}

private class MyDelegatedObject(actual: MyObject) : DelegatedClass<MyObject>(actual)
Expand Down

0 comments on commit 2b59dcd

Please sign in to comment.