am 352b0352: am 33a226f8: Merge "Small simplification (A3)" into jb-mr1-dev

* commit '352b0352a81565d6c0f3fa92c2033982330d54ac':
  Small simplification (A3)
main
Jean Chalard 2012-09-14 10:30:02 -07:00 committed by Android Git Automerger
commit f8ec3887af
1 changed files with 2 additions and 5 deletions

View File

@ -220,7 +220,7 @@ public final class StringUtils {
public static int getCapsMode(CharSequence cs, int reqModes) { public static int getCapsMode(CharSequence cs, int reqModes) {
int i; int i;
char c; char c;
int mode = 0; int mode = TextUtils.CAP_MODE_CHARACTERS;
// Quick description of what we want to do: // Quick description of what we want to do:
// CAP_MODE_CHARACTERS is always on. // CAP_MODE_CHARACTERS is always on.
@ -235,13 +235,10 @@ public final class StringUtils {
// periods interleaved. // periods interleaved.
// Step 1 : check for cap mode characters. If it's looked for, it's always on. // Step 1 : check for cap mode characters. If it's looked for, it's always on.
if ((reqModes & TextUtils.CAP_MODE_CHARACTERS) != 0) {
mode |= TextUtils.CAP_MODE_CHARACTERS;
}
if ((reqModes & (TextUtils.CAP_MODE_WORDS | TextUtils.CAP_MODE_SENTENCES)) == 0) { if ((reqModes & (TextUtils.CAP_MODE_WORDS | TextUtils.CAP_MODE_SENTENCES)) == 0) {
// Here we are not looking for words or sentences modes, so since we already evaluated // Here we are not looking for words or sentences modes, so since we already evaluated
// mode characters, we can return. // mode characters, we can return.
return mode; return mode & reqModes;
} }
// Step 2 : Skip (ignore at the end of input) any opening punctuation. This includes // Step 2 : Skip (ignore at the end of input) any opening punctuation. This includes