More source code to format...

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1560751 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benedikt Ritter 2014-01-23 17:01:48 +00:00
parent 7d4041d827
commit b44b35129e
1 changed files with 6 additions and 12 deletions

View File

@ -7123,19 +7123,15 @@ public class StringUtils {
* @param second The second string. * @param second The second string.
* @return A number between 0 and 4. * @return A number between 0 and 4.
*/ */
private static int commonPrefixLength(CharSequence first, CharSequence second) private static int commonPrefixLength(CharSequence first, CharSequence second) {
{
String shorter; String shorter;
String longer; String longer;
// Determine which String is longer. // Determine which String is longer.
if (first.length() > second.length()) if (first.length() > second.length()) {
{
longer = first.toString().toLowerCase(); longer = first.toString().toLowerCase();
shorter = second.toString().toLowerCase(); shorter = second.toString().toLowerCase();
} } else {
else
{
longer = second.toString().toLowerCase(); longer = second.toString().toLowerCase();
shorter = first.toString().toLowerCase(); shorter = first.toString().toLowerCase();
} }
@ -7143,10 +7139,8 @@ public class StringUtils {
int result = 0; int result = 0;
// Iterate through the shorter string. // Iterate through the shorter string.
for (int i = 0; i < shorter.length(); i++) for (int i = 0; i < shorter.length(); i++) {
{ if (shorter.charAt(i) != longer.charAt(i)) {
if (shorter.charAt(i) != longer.charAt(i))
{
break; break;
} }
result++; result++;