8321059: Unneeded array assignments in MergeCollation and CompactByteArray
Reviewed-by: jlu, bpb, rriggs
This commit is contained in:
parent
d568562966
commit
f6be7fdf22
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -68,8 +68,6 @@ final class MergeCollation {
|
|||||||
*/
|
*/
|
||||||
public MergeCollation(String pattern) throws ParseException
|
public MergeCollation(String pattern) throws ParseException
|
||||||
{
|
{
|
||||||
for (int i = 0; i < statusArray.length; i++)
|
|
||||||
statusArray[i] = 0;
|
|
||||||
setPattern(pattern);
|
setPattern(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
package sun.text;
|
package sun.text;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class CompactATypeArray : use only on primitive data types
|
* class CompactATypeArray : use only on primitive data types
|
||||||
* Provides a compact way to store information that is indexed by Unicode
|
* Provides a compact way to store information that is indexed by Unicode
|
||||||
@ -77,12 +79,11 @@ public final class CompactByteArray implements Cloneable {
|
|||||||
values = new byte[UNICODECOUNT];
|
values = new byte[UNICODECOUNT];
|
||||||
indices = new short[INDEXCOUNT];
|
indices = new short[INDEXCOUNT];
|
||||||
hashes = new int[INDEXCOUNT];
|
hashes = new int[INDEXCOUNT];
|
||||||
for (i = 0; i < UNICODECOUNT; ++i) {
|
if (defaultValue != (byte)0) {
|
||||||
values[i] = defaultValue;
|
Arrays.fill(values, defaultValue);
|
||||||
}
|
}
|
||||||
for (i = 0; i < INDEXCOUNT; ++i) {
|
for (i = 0; i < INDEXCOUNT; ++i) {
|
||||||
indices[i] = (short)(i<<BLOCKSHIFT);
|
indices[i] = (short)(i<<BLOCKSHIFT);
|
||||||
hashes[i] = 0;
|
|
||||||
}
|
}
|
||||||
isCompact = false;
|
isCompact = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user