Skip to content
Snippets Groups Projects
Commit 7e78179b authored by Lukas Stadler's avatar Lukas Stadler
Browse files

minor cleanups

parent 71e2a03c
No related branches found
No related tags found
No related merge requests found
...@@ -52,13 +52,13 @@ public abstract class CRC64 extends RBuiltinNode { ...@@ -52,13 +52,13 @@ public abstract class CRC64 extends RBuiltinNode {
bytes = crc64(bytes); bytes = crc64(bytes);
long l = 0; long l = 0;
for (int i = 0; i < bytes.length; i++) { for (int i = 0; i < bytes.length; i++) {
l += ((long) bytes[i] & 0xffL) << (8 * i); l += (bytes[i] & 0xffL) << (8 * i);
} }
return RDataFactory.createStringVector(Long.toHexString(l)); return RDataFactory.createStringVector(Long.toHexString(l));
} }
@TruffleBoundary @TruffleBoundary
private byte[] crc64(byte[] bytes) { private static byte[] crc64(byte[] bytes) {
org.tukaani.xz.check.CRC64 crc = new org.tukaani.xz.check.CRC64(); org.tukaani.xz.check.CRC64 crc = new org.tukaani.xz.check.CRC64();
crc.update(bytes); crc.update(bytes);
return crc.finish(); return crc.finish();
......
...@@ -55,7 +55,7 @@ public class TestTestBase extends TestBase { ...@@ -55,7 +55,7 @@ public class TestTestBase extends TestBase {
getCode("cat('Warning message: In .Internal(foo(42)): IgnoreWarningContext diff message')", "cat('Warning message in foo(42): IgnoreWarningContext should fail')")); getCode("cat('Warning message: In .Internal(foo(42)): IgnoreWarningContext diff message')", "cat('Warning message in foo(42): IgnoreWarningContext should fail')"));
} }
private String getCode(String fastr, String gnur) { private static String getCode(String fastr, String gnur) {
return "if (exists('.fastr.identity')) { " + fastr + " } else { " + gnur + " }"; return "if (exists('.fastr.identity')) { " + fastr + " } else { " + gnur + " }";
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment