summaryrefslogtreecommitdiff
path: root/test/pending/shootout/revcomp.scala-2.scala
diff options
context:
space:
mode:
authorDen Shabalin <den.shabalin@gmail.com>2013-11-13 15:33:33 +0100
committerDen Shabalin <den.shabalin@gmail.com>2013-11-20 16:06:30 +0100
commitb004c3ddb38f8e690a0895a51ad0c83ff57a01e7 (patch)
tree0c31f83d2e039db4c2ead7a3280aaabc78671333 /test/pending/shootout/revcomp.scala-2.scala
parentc243435f113615b2f7407fbd683c93ec16c73749 (diff)
downloadscala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.tar.gz
scala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.tar.bz2
scala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.zip
deprecate Pair and Triple
Diffstat (limited to 'test/pending/shootout/revcomp.scala-2.scala')
-rw-r--r--test/pending/shootout/revcomp.scala-2.scala18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/pending/shootout/revcomp.scala-2.scala b/test/pending/shootout/revcomp.scala-2.scala
index 92260ad021..03fb25af1b 100644
--- a/test/pending/shootout/revcomp.scala-2.scala
+++ b/test/pending/shootout/revcomp.scala-2.scala
@@ -6,7 +6,7 @@
import java.io._
import scala.collection.mutable.Stack
-object revcomp {
+object revcomp {
val IUB = IUBCodeComplements
@@ -16,7 +16,7 @@ object revcomp {
val a: Array[Byte] = new Array( 'z'.toByte )
for (indexValue <- code zip comp)
- indexValue match { case Pair(i,v) => a(i) = v }
+ indexValue match { case (i,v) => a(i) = v }
a
}
@@ -49,18 +49,18 @@ object revcomp {
if (desc.length > 0) complementReverseWrite(desc, lines, w)
w.close
- }
+ }
- def complementReverseWrite(desc: String, lines: LineStack,
+ def complementReverseWrite(desc: String, lines: LineStack,
w: BufferedOutputStream) = {
def inplaceComplementReverse(b: Array[Byte]) = {
- var i = 0
+ var i = 0
var j = b.length - 1
while (i < j){
- val swap = b(i)
- b(i) = IUB( b(j) )
+ val swap = b(i)
+ b(i) = IUB( b(j) )
b(j) = IUB( swap )
i = i + 1
j = j - 1
@@ -79,11 +79,11 @@ object revcomp {
while (!lines.isEmpty) {
val line = lines.pop
inplaceComplementReverse(line)
-
+
if (isSplitLine){
if (isFirstLine){ w.write(line); isFirstLine = false }
else { w.write(line,0,n-k); w.write(nl); w.write(line,n-k,k) }
- }
+ }
else { w.write(line); w.write(nl) }
}
if (isSplitLine && !isFirstLine) w.write(nl)