Skip to content
Snippets Groups Projects
Commit 60a2e35f authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Remove overflow and underflow check in `shortArrayToIntArray`

parent 306bd1a8
No related branches found
No related tags found
No related merge requests found
...@@ -22,13 +22,8 @@ public class TypeConverter { ...@@ -22,13 +22,8 @@ public class TypeConverter {
public static int[] shortArrayToIntArray(final short[] src) { public static int[] shortArrayToIntArray(final short[] src) {
int[] result = new int[src.length]; int[] result = new int[src.length];
int intValue;
for (int i = 0; i < src.length; i++) { for (int i = 0; i < src.length; i++) {
intValue = shortToInt(src[i]); result[i] = shortToInt(src[i]);
if (intValue < U16.Min || intValue > U16.Max) {
throw new RuntimeException("Source value is outside of bounds for 16-bit unsigned integer.");
}
result[i] = intValue;
} }
return result; return result;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment