Created
October 28, 2011 09:35
-
-
Save notyy/1321966 to your computer and use it in GitHub Desktop.
change to func
This file contains 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
def assertArray(b1: Array[Byte], b2: Array[Byte]) { | |
if (b1 == null && b2 == null) return; | |
else if (b1 != null && b2 != null) { | |
if (b1.length != b2.length) throw new AssertionError("b1.length != b2.length") | |
else { | |
for (i <- b1.indices) { | |
if (b1(i) != b2(i)) throw new AssertionError("b1(%d) != b2(%d)".format(i, i)) | |
} | |
} | |
} else { | |
throw new AssertionError("b1 is null while b2 is not, vice versa") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment