Last active
October 25, 2019 09:22
-
-
Save SylvainHocq/d6a6ad547c5cfd25ac7482f1a98c74ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline fun <A, B, R> ifNotNull(a: A?, b: B?, code: (A, B) -> R) { | |
if (a != null && b != null) { | |
code(a, b) | |
} | |
} | |
inline fun <A, B, C, R> ifNotNull(a: A?, b: B?, c: C?, code: (A, B, C) -> R) { | |
if (a != null && b != null && c != null) { | |
code(a, b, c) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment