mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
6714245: [Col] Collator - Faster Comparison for identical strings.
Reviewed-by: rriggs, naoto
This commit is contained in:
parent
a284920b34
commit
4441a2306f
1 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -358,6 +358,10 @@ public class RuleBasedCollator extends Collator{
|
|||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
if (source.equals(target)) {
|
||||
return Collator.EQUAL;
|
||||
}
|
||||
|
||||
// The basic algorithm here is that we use CollationElementIterators
|
||||
// to step through both the source and target strings. We compare each
|
||||
// collation element in the source string against the corresponding one
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue