mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8274949: Use String.contains() instead of String.indexOf() in java.base
Reviewed-by: weijun, dfuchs, vtewari, lancea
This commit is contained in:
parent
09e8c8c64a
commit
6677554374
17 changed files with 35 additions and 38 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2021, 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
|
||||
|
@ -83,7 +83,7 @@ public final class LocaleMatcher {
|
|||
for (LanguageRange lr : priorityList) {
|
||||
String range = lr.getRange();
|
||||
if (range.startsWith("*-")
|
||||
|| range.indexOf("-*") != -1) { // Extended range
|
||||
|| range.contains("-*")) { // Extended range
|
||||
if (mode == AUTOSELECT_FILTERING) {
|
||||
return filterExtended(priorityList, tags);
|
||||
} else if (mode == MAP_EXTENDED_RANGES) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue