Skip to content

Commit

Permalink
define arch befote if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
samelamin committed Mar 30, 2017
1 parent bf7cc24 commit 77777e9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public final class Platform {
private static final boolean unaligned;
static {
boolean _unaligned;
String arch = System.getProperty("os.arch", "");
if (arch.matches("^(ppc64le | ppc64)$")) {
// Since java.nio.Bits.unaligned() doesn't return true on ppc (See JDK-8165231), but ppc64 and ppc64le support it
_unaligned = true;
Expand All @@ -58,7 +59,6 @@ public final class Platform {
_unaligned = Boolean.TRUE.equals(unalignedMethod.invoke(null));
} catch (Throwable t) {
// We at least know x86 and x64 support unaligned access.
String arch = System.getProperty("os.arch", "");
//noinspection DynamicRegexReplaceableByCompiledPattern
_unaligned = arch.matches("^(i[3-6]86|x86(_64)?|x64|amd64|aarch64)$");
}
Expand Down

0 comments on commit 77777e9

Please sign in to comment.