Skip to content

Commit

Permalink
Merge pull request #3 from Devansh-Maurya/master
Browse files Browse the repository at this point in the history
Added XNOR operator as an extension function
  • Loading branch information
jitinsharma committed Oct 10, 2019
2 parents d634f06 + 61e8ab4 commit 7136699
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion GeneralExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ inline fun lollipopAndAbove(block : () -> Unit) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
block()
}
}
}

/**
* XNOR operator using XOR operator
*/
infix fun Boolean.xnor(other: Boolean): Boolean = !(this.xor(other))

0 comments on commit 7136699

Please sign in to comment.