File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
src/java.base/share/classes Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 1996, 2022 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 1996, 2023 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -68,8 +68,6 @@ final class MergeCollation {
6868 */
6969 public MergeCollation (String pattern ) throws ParseException
7070 {
71- for (int i = 0 ; i < statusArray .length ; i ++)
72- statusArray [i ] = 0 ;
7371 setPattern (pattern );
7472 }
7573
Original file line number Diff line number Diff line change 3939package sun .text ;
4040
4141
42+ import java .util .Arrays ;
43+
4244/**
4345 * class CompactATypeArray : use only on primitive data types
4446 * Provides a compact way to store information that is indexed by Unicode
@@ -77,12 +79,11 @@ public CompactByteArray(byte defaultValue)
7779 values = new byte [UNICODECOUNT ];
7880 indices = new short [INDEXCOUNT ];
7981 hashes = new int [INDEXCOUNT ];
80- for ( i = 0 ; i < UNICODECOUNT ; ++ i ) {
81- values [ i ] = defaultValue ;
82+ if ( defaultValue != ( byte ) 0 ) {
83+ Arrays . fill ( values , defaultValue ) ;
8284 }
8385 for (i = 0 ; i < INDEXCOUNT ; ++i ) {
8486 indices [i ] = (short )(i <<BLOCKSHIFT );
85- hashes [i ] = 0 ;
8687 }
8788 isCompact = false ;
8889 }
You can’t perform that action at this time.
0 commit comments