egslava

JVM/Kotlin. Better performance if exception is thrown

Sep 15th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. val String.reverseComplement11: String get(){
  2.     val thisLength = length - 1
  3.     return String( CharArray(thisLength + 1) {
  4.         val complementedChar = this[thisLength - it].complement1
  5.         if (complementedChar != '-') complementedChar else throw InvalidAlgorithmParameterException("Shit")
  6.     })
  7. }
Advertisement
Add Comment
Please, Sign In to add comment